* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #f8fafc;
    background:
        radial-gradient(circle at top, rgba(124, 58, 237, 0.16), transparent 28%),
        radial-gradient(circle at bottom, rgba(236, 72, 153, 0.12), transparent 30%),
        #030712;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.98) 0%, rgba(17, 24, 39, 0.88) 50%, rgba(3, 7, 18, 0.98) 100%);
    z-index: -1;
}

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    padding: 72px 0 110px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid rgba(236, 72, 153, 0.28);
    border-radius: 999px;
    background: rgba(76, 5, 25, 0.35);
    color: #ff5fa2;
    font-size: 0.95rem;
    box-shadow: 0 0 26px rgba(236, 72, 153, 0.12);
}

.logo {
    margin: 22px 0 12px;
    font-size: clamp(3.2rem, 8vw, 5rem);
    line-height: 1;
    font-weight: 700;
}

.logo-pink {
    color: #ff4d9d;
}

.logo-blue {
    color: #60d8ff;
}

.hero-text {
    margin: 0 auto;
    max-width: 780px;
    color: #94a3b8;
    font-size: clamp(1.1rem, 2.5vw, 1.9rem);
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 34px;
    flex-wrap: wrap;
    margin: 34px 0 28px;
    color: #a78bfa;
    font-size: 1rem;
}

.hero-features span:nth-child(1) {
    color: #f472b6;
}

.hero-features span:nth-child(2) {
    color: #22d3ee;
}

.download-form {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(840px, 100%);
    margin: 0 auto;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08), 0 22px 55px rgba(2, 6, 23, 0.56);
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 0 18px;
    min-height: 58px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.72);
}

.input-icon {
    position: relative;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    flex-shrink: 0;
}

.input-icon::before,
.input-icon::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.input-icon::before {
    top: 1px;
    left: 0;
    transform: rotate(-35deg);
}

.input-icon::after {
    right: 0;
    bottom: 1px;
    transform: rotate(-35deg);
}

input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #f8fafc;
    font-size: 1rem;
}

input::placeholder {
    color: #64748b;
}

button {
    min-width: 170px;
    min-height: 58px;
    border: 0;
    border-radius: 16px;
    padding: 0 28px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 100%);
    box-shadow: 0 16px 32px rgba(139, 92, 246, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(236, 72, 153, 0.3);
}

button:disabled {
    opacity: 0.82;
    cursor: wait;
    transform: none;
}

.example {
    margin-top: 16px;
    color: #64748b;
    font-size: 0.95rem;
}

.audience-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(520px, 100%);
    margin: 28px auto 0;
}

.audience-card {
    padding: 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    background: rgba(8, 15, 32, 0.74);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
}

.audience-label {
    display: block;
    color: #94a3b8;
    font-size: 0.92rem;
}

.audience-value {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    line-height: 1;
    color: #f8fafc;
}

.steps {
    padding: 0 0 90px;
    text-align: center;
}

.steps h2 {
    margin: 0 0 52px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.step-card {
    padding: 26px 22px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 24px;
    background: rgba(8, 15, 32, 0.74);
}

.step-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.step-icon.pink {
    background: rgba(236, 72, 153, 0.14);
    color: #ff5fa2;
}

.step-icon.cyan {
    background: rgba(34, 211, 238, 0.14);
    color: #67e8f9;
}

.step-icon.purple {
    background: rgba(139, 92, 246, 0.14);
    color: #c084fc;
}

.step-label {
    display: block;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.step-card h3 {
    margin: 0 0 12px;
    font-size: 1.55rem;
}

.step-card p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.6;
    font-size: 1rem;
}

.footer {
    padding: 28px 16px 34px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    text-align: center;
    color: #64748b;
    background: rgba(2, 6, 23, 0.68);
}

.footer p {
    margin: 6px 0;
}

.footer a,
.secondary-link,
.stats-extra a {
    color: #60d8ff;
    text-decoration: none;
}

.footer a:hover,
.secondary-link:hover,
.stats-extra a:hover {
    text-decoration: underline;
}

.result-card,
.admin-panel {
    width: min(720px, 100%);
    margin: 32px auto 0;
    padding: 32px 28px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 28px;
    background: rgba(8, 15, 32, 0.78);
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.45);
}

.panel-text,
.admin-subtitle,
.loading-subtitle {
    color: #94a3b8;
    line-height: 1.7;
}

.loader-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.inline-loader-section {
    display: none;
    width: min(840px, 100%);
    margin: 0 auto;
    padding-top: 42px;
}

.inline-loader-section.is-visible {
    display: flex;
    justify-content: center;
}

.loading-card {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 40px 38px 34px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 24px;
    background: rgba(5, 10, 24, 0.92);
    text-align: center;
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.5);
}

.status-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-icon-loading {
    background: rgba(236, 72, 153, 0.14);
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.06);
}

.status-icon-success {
    background: rgba(34, 197, 94, 0.14);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.06);
}

.clock-icon,
.check-icon {
    position: absolute;
    width: 42px;
    height: 42px;
}

.clock-icon::before,
.check-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.clock-icon::before {
    border: 4px solid #ff3d8e;
}

.clock-icon::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 20px;
    width: 4px;
    height: 13px;
    border-radius: 999px;
    background: #ff3d8e;
    box-shadow: 8px 8px 0 -1px #ff3d8e;
    transform-origin: bottom center;
}

.check-icon {
    opacity: 0;
}

.check-icon::before {
    border: 4px solid #22c55e;
}

.check-icon::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 12px;
    width: 16px;
    height: 9px;
    border-left: 4px solid #22c55e;
    border-bottom: 4px solid #22c55e;
    transform: rotate(-45deg);
}

.status-icon-success .clock-icon {
    opacity: 0;
}

.status-icon-success .check-icon {
    opacity: 1;
}

.loading-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.2;
}

.loading-subtitle {
    margin: 12px 0 26px;
    font-size: 1rem;
}

.progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(131, 24, 67, 0.5);
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff2f86 0%, #ff4da6 100%);
    transition: width 1s linear;
}

.loading-number {
    min-height: 74px;
    margin-top: 18px;
    font-size: 4rem;
    line-height: 1;
    font-weight: 700;
    color: #ff2f86;
}

.download-hidden {
    display: none;
    margin-top: 28px;
}

.download-hidden.is-visible {
    display: block;
}

.download-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 440px);
    min-height: 68px;
    border-radius: 16px;
    padding: 0 28px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(180deg, #29cf67 0%, #14a75d 100%);
    box-shadow: 0 14px 30px rgba(20, 167, 93, 0.32);
}

.download-cta:hover {
    filter: brightness(1.03);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 58px;
    border-radius: 16px;
    padding: 0 28px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 100%);
    box-shadow: 0 16px 32px rgba(139, 92, 246, 0.28);
}

.secondary-link {
    display: inline-block;
    margin-top: 22px;
}

.admin-page {
    padding: 56px 0 80px;
}

.admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-login-card {
    width: min(460px, 100%);
    padding: 34px 30px 30px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 26px;
    background: rgba(5, 10, 24, 0.92);
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.5);
}

.admin-login-title {
    margin: 18px 0 10px;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.admin-login-subtitle {
    margin: 0 0 22px;
    color: #94a3b8;
    line-height: 1.7;
}

.admin-login-alert {
    width: 100%;
    margin: 0 0 18px;
}

.admin-login-form {
    display: grid;
    gap: 14px;
}

.admin-login-form label {
    color: #cbd5e1;
    font-weight: 700;
}

.admin-login-form input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
}

.admin-login-form button {
    margin-top: 8px;
}

.alert {
    width: min(1120px, 100%);
    margin: 26px auto 0;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.admin-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.admin-main-title {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
}

.admin-kicker {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 1.05rem;
}

.admin-kicker span {
    color: #cbd5e1;
}

.admin-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    background: rgba(2, 6, 23, 0.72);
}

.admin-logout:hover {
    text-decoration: none;
    background: rgba(15, 23, 42, 0.88);
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    margin-top: 26px;
}

.admin-panel {
    width: 100%;
    margin-top: 0;
    text-align: left;
}

.admin-panel .admin-metrics {
    margin-top: 0;
}

.admin-panel-wide {
    width: min(1120px, 100%);
    margin: 26px auto 0;
    padding: 28px 30px;
}

.metric-card {
    padding: 30px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 24px;
    background: rgba(5, 10, 24, 0.92);
    box-shadow: 0 22px 55px rgba(2, 6, 23, 0.45);
}

.metric-card h2 {
    margin: 0;
    font-size: 1.2rem;
}

.metric-card strong {
    display: block;
    margin-top: 28px;
    font-size: 4rem;
    line-height: 1;
}

.metric-card-pink strong {
    color: #ff2f86;
}

.metric-card-green strong {
    color: #22c55e;
}

.metric-card-blue strong {
    color: #60d8ff;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.section-head h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.9rem;
}

.section-meta {
    color: #94a3b8;
    font-size: 0.98rem;
}

.admin-inner-card {
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.56);
}

.admin-inner-card h3 {
    margin: 0 0 20px;
    font-size: 1.55rem;
}

.admin-form {
    margin-top: 0;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.admin-form label {
    display: block;
    margin-bottom: 10px;
    color: #cbd5e1;
    font-weight: 700;
}

.admin-form input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
}

.admin-add-button {
    min-width: 132px;
    min-height: 56px;
}

.admin-links-list {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.affiliate-row,
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.affiliate-info {
    min-width: 0;
}

.affiliate-info strong,
.download-url {
    display: block;
    color: #e2e8f0;
    font-size: 1rem;
    word-break: break-word;
}

.affiliate-info span {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.94rem;
    word-break: break-word;
}

.affiliate-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.affiliate-clicks-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(255, 47, 134, 0.24);
    border-radius: 999px;
    background: rgba(76, 5, 25, 0.32);
    color: #f8fafc;
}

.affiliate-clicks-badge strong {
    color: #ff2f86;
    font-size: 1.2rem;
    line-height: 1;
}

.affiliate-clicks-badge span {
    color: #cbd5e1;
    font-size: 1rem;
}

.affiliate-delete-form {
    margin: 0;
}

.affiliate-delete-button {
    min-width: 88px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(248, 113, 113, 0.22);
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.22);
    color: #f87171;
    box-shadow: none;
}

.affiliate-delete-button:hover {
    box-shadow: none;
    background: rgba(127, 29, 29, 0.32);
}

.badge-active,
.download-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: lowercase;
}

.badge-active,
.download-status.success {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.download-status.pending {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.link-action-button {
    min-width: 88px;
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.95rem;
    border-radius: 999px;
}

.downloads-list {
    display: grid;
    gap: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.stat-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
}

.stat-card span {
    display: block;
    color: #94a3b8;
    font-size: 0.92rem;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1.4;
    word-break: break-word;
}

.stats-extra {
    margin-top: 20px;
    color: #94a3b8;
    line-height: 1.7;
}

@media (max-width: 840px) {
    .hero {
        padding-top: 56px;
    }

    .download-form {
        flex-direction: column;
    }

    .input-wrap,
    button {
        width: 100%;
    }

    button {
        min-width: 0;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .audience-stats {
        grid-template-columns: 1fr;
    }

    .admin-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-metrics,
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar,
    .section-head,
    .affiliate-row,
    .download-item {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-logout,
    .link-action-button,
    .badge-active,
    .download-status {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .page {
        width: min(100% - 20px, 1100px);
    }

    .hero-features {
        gap: 16px;
        font-size: 0.95rem;
    }

    .download-form {
        padding: 8px;
        border-radius: 18px;
    }

    .input-wrap {
        min-height: 54px;
        padding: 0 14px;
    }

    .result-card,
    .admin-panel {
        padding: 24px 18px;
        border-radius: 22px;
    }

    .loading-card {
        width: min(100%, 520px);
        padding: 32px 20px 28px;
        border-radius: 22px;
    }

    .btn-link,
    button,
    .download-cta {
        min-width: 0;
    }

    .status-icon {
        width: 86px;
        height: 86px;
    }

    .loading-number {
        font-size: 3.4rem;
    }
}
