:root {
    --bg: #0f0b1a;
    --card: rgba(26, 19, 42, 0.9);
    --primary: #7D5BFF;
    --accent: #F6C945;
    --muted: #b8b4ca;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Vazirmatn", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, rgba(125, 91, 255, 0.2), transparent 45%), var(--bg);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: min(420px, 95vw);
    background: var(--card);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.auth-card h1 {
    margin-top: 0;
    font-size: 26px;
    margin-bottom: 10px;
}

.auth-card p.subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.7;
}

.auth-card form {
    display: grid;
    gap: 18px;
}

.captcha-block {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(15, 10, 26, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.captcha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
}

.captcha-refresh {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.captcha-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.captcha-visual {
    position: relative;
    background: rgba(14, 9, 24, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.captcha-visual img {
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

.captcha-status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: var(--muted);
    background: rgba(15, 10, 26, 0.75);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.captcha-status.active {
    opacity: 1;
}

.captcha-input-label {
    display: grid;
    gap: 8px;
}

.captcha-input {
    text-transform: uppercase;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 500;
}

input,
select,
textarea {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 6, 20, 0.6);
    color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(125, 91, 255, 0.4);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

button,
.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: #fff;
}

button.primary {
    background: linear-gradient(135deg, #7D5BFF, #4D3CF7);
    box-shadow: 0 15px 35px rgba(125, 91, 255, 0.35);
}

button.primary:hover,
.auth-link:hover {
    transform: translateY(-2px);
}

.btn-light {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #d7263d);
    border: none;
    box-shadow: 0 18px 40px rgba(215, 38, 61, 0.35);
}

.btn-danger:hover,
.btn-danger:focus {
    box-shadow: 0 20px 48px rgba(215, 38, 61, 0.45);
}

.resend-section {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.resend-section .countdown {
    font-size: 14px;
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field span {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.auth-footer {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.message {
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    line-height: 1.6;
    font-size: 14px;
}

.message.success {
    border-color: rgba(105, 212, 150, 0.4);
    background: rgba(0, 128, 64, 0.15);
}

.message.error {
    border-color: rgba(242, 95, 112, 0.4);
    background: rgba(120, 24, 36, 0.2);
}

.message.info {
    border-color: rgba(92, 173, 255, 0.4);
    background: rgba(40, 120, 210, 0.15);
    color: #dcecff;
}

.auth-link {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-link.secondary {
    background: rgba(10, 6, 20, 0.4);
}

.licenses-grid {
    display: grid;
    gap: 18px;
}
.license-card {
    border-radius: 16px;
    background: rgba(23, 17, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    display: grid;
    gap: 10px;
}

/* License key display */
.license-key {
    display: grid;
    gap: 6px;
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
}

.license-key__value {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.license-key > span,
.license-key__code {
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(12, 8, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-family: "Vazirmatn", monospace;
    font-size: 14px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    direction: ltr;
    text-align: left;
    scrollbar-width: thin;
}

.license-key__code {
    flex: 1 1 260px;
}

.license-key > span::-webkit-scrollbar,
.license-key__code::-webkit-scrollbar {
    height: 6px;
}

.license-key > span::-webkit-scrollbar-thumb,
.license-key__code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
}

.license-key > span::-webkit-scrollbar-track,
.license-key__code::-webkit-scrollbar-track {
    background: transparent;
}

.copy-license-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #2e6fe6, #5f8dfa);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(46, 111, 230, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.copy-license-btn:hover,
.copy-license-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(46, 111, 230, 0.45);
    background: linear-gradient(135deg, #366df3, #6fa2ff);
}

.copy-license-btn.copied {
    background: linear-gradient(135deg, #3fa45a, #62c27a);
    box-shadow: 0 10px 22px rgba(63, 164, 90, 0.35);
}

@media (max-width: 600px) {
    .license-key__value {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .license-key__code {
        flex: none;
        width: 100%;
        white-space: normal;
        word-break: break-all;
        overflow-x: hidden;
    }

    .copy-license-btn {
        width: 100%;
        justify-content: center;
    }
}

.license-card.manage {
    position: relative;
    gap: 14px;
}

.license-card.manage .license-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.license-card.manage .license-edit-form {
    display: none;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    gap: 14px;
}

.license-card.manage.expanded .license-edit-form {
    display: grid;
}

.license-card.manage .license-edit-form .form-row,
.license-card.manage .license-edit-form .form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.license-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(246, 201, 69, 0.16);
    color: var(--accent);
}
