@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --primary:       #4F46E5;
    --primary-light: #6366F1;
    --primary-dark:  #3730A3;
    --accent:        #06B6D4;
    --success:       #10B981;
    --danger:        #EF4444;
    --warning:       #F59E0B;

    --bg-base:       #0F0F1A;
    --bg-card:       rgba(255, 255, 255, 0.04);
    --bg-input:      rgba(255, 255, 255, 0.06);
    --border:        rgba(255, 255, 255, 0.10);
    --border-focus:  rgba(99, 102, 241, 0.60);

    --text-primary:  #F1F5F9;
    --text-muted:    #94A3B8;
    --text-subtle:   #64748B;

    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     20px;
    --radius-xl:     28px;

    --shadow-card:   0 8px 32px rgba(0,0,0,0.40);
    --shadow-glow:   0 0 40px rgba(79,70,229,0.25);

    --transition:    0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(79,70,229,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 85%, rgba(6,182,212,0.14) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 55% 50%, rgba(99,102,241,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   LAYOUT
   ============================================ */
.wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
}

/* ============================================
   HEADER / BRAND
   ============================================ */
.brand-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
    text-align: center;
    flex-direction: column;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(79,70,229,0.45);
    font-size: 26px;
}

.brand-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 20%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* ============================================
   CARD
   ============================================ */
.card {
    width: 100%;
    max-width: 680px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    overflow: hidden;
}

.card-header {
    padding: 28px 32px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79,70,229,0.35), rgba(6,182,212,0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card-header-text h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-header-text p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.card-body { padding: 28px 32px; }

/* ============================================
   SECTION LABEL
   ============================================ */
.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ============================================
   FORM GRID
   ============================================ */
.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 540px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .card-body { padding: 20px; }
    .card-header { padding: 20px; }
}

/* ============================================
   FORM FIELDS
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 7px; }

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .label-icon { font-size: 13px; opacity: 0.75; }

.form-control {
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    width: 100%;
}

.form-control::placeholder { color: var(--text-subtle); }

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: rgba(255,255,255,0.08);
}

.form-control:hover:not(:focus) {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
}

.form-control[readonly] {
    cursor: default;
    color: var(--text-subtle);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* ============================================
   PASSWORD FIELD
   ============================================ */
.password-wrapper { position: relative; }

.password-wrapper .form-control { padding-right: 110px; }

.btn-regen {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.35);
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    letter-spacing: 0.3px;
}

.btn-regen:hover {
    background: rgba(99,102,241,0.35);
    border-color: rgba(99,102,241,0.6);
    color: #fff;
}

/* ============================================
   TOGGLE
   ============================================ */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.toggle-label { font-size: 13.5px; flex: 1; color: var(--text-primary); }
.toggle-label span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.12);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    left: 3px;
    top: 3px;
    transition: transform var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================
   LICENSE BADGE LIST
   ============================================ */
.license-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.license-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.license-item:hover { border-color: rgba(255,255,255,0.18); }

.license-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(79,70,229,0.5);
}

.license-info { flex: 1; }
.license-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.license-sku  { font-size: 11px; color: var(--text-subtle); font-family: 'Courier New', monospace; margin-top: 1px; }

.license-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(16,185,129,0.15);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.25);
    letter-spacing: 0.5px;
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(79,70,229,0.45);
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79,70,229,0.60);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: none;
}

.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { opacity: 0.8; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   ALERTS / RESULT PANEL
   ============================================ */
.alert {
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 13.5px;
    line-height: 1.6;
    border: 1px solid transparent;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(16,185,129,0.10);
    border-color: rgba(16,185,129,0.30);
    color: #6EE7B7;
}

.alert-error {
    background: rgba(239,68,68,0.10);
    border-color: rgba(239,68,68,0.30);
    color: #FCA5A5;
}

.alert-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-top: 12px;
}

.result-table th {
    text-align: left;
    padding: 6px 10px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.result-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
    vertical-align: top;
}

.result-table td:first-child { color: var(--text-muted); width: 140px; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.status-ok  { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.status-err { background: rgba(239,68,68,0.15);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.25);  }

/* ============================================
   HELPER HINT
   ============================================ */
.hint {
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-top: 4px;
}

/* ============================================
   PROFILE INFO ACCORDION
   ============================================ */
.profile-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.profile-accordion[open] {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}

.profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background var(--transition);
}

.profile-summary::-webkit-details-marker { display: none; }

.profile-summary:hover {
    background: rgba(255,255,255,0.04);
}

.profile-summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-optional-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(99,102,241,0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.25);
    letter-spacing: 0.4px;
}

.accordion-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.profile-accordion[open] .accordion-chevron {
    transform: rotate(180deg);
}

.profile-body {
    padding: 16px 16px 20px;
    border-top: 1px solid var(--border);
    animation: expandIn 0.22s ease;
}

@keyframes expandIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-subtle);
    text-align: center;
    letter-spacing: 0.3px;
}
