/* ============================================================
   myDiviMax — auth.css
   Styles for: register.html, signin.html, account.html,
               reset-password.html
   Uses the same color schema as style.css
   ============================================================ */

/* ── Layout ── */
.auth-section {
    min-height: calc(100vh - 250px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: var(--header-bg);
}

.auth-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 1.8rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ── Card header ── */
.auth-card-icon {
    width: 40px;
    height: 40px;
    background: var(--green);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
}
.auth-card-icon.blue  { background: #2980b9; }
.auth-card-icon.purple { background: #8e44ad; }
.auth-card-icon svg { width: 20px; height: 20px; fill: #fff; }

.auth-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.2rem;
}

.auth-card-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 1.2rem;
}

/* ── Form elements ── */
.auth-form-group {
    margin-bottom: 0.85rem;
}

.auth-form-group label {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    margin-bottom: 0.3rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-form-group input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 7px;
    padding: 0.55rem 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    border-color: var(--green);
    background: rgba(255,255,255,0.12);
}

.auth-form-group input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* Password field wrapper for show/hide toggle */
.pw-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-wrap input {
    padding-right: 2.6rem;
}

.pw-toggle {
    position: absolute;
    right: 0.7rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.pw-toggle:hover { color: rgba(255,255,255,0.8); }

.pw-toggle svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    pointer-events: none;
}

/* ── Password strength ── */
.pw-strength-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.pw-strength-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.2rem;
}

/* ── Buttons ── */
.auth-btn {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--green);
    border: none;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
}

.auth-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.auth-btn.slim   { width: auto; margin-top: 0; }

/* ── Divider & footer links ── */
.auth-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 1rem 0 0.9rem;
}

.auth-footer-links {
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
}

.auth-footer-links a {
    color: #6ee08a;
    text-decoration: none;
}

.auth-footer-links a:hover { text-decoration: underline; }

.forgot-link {
    display: block;
    text-align: right;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    margin-top: 0.25rem;
}

.forgot-link:hover { color: #6ee08a; }

/* ── Alerts ── */
.auth-alert {
    padding: 0.6rem 0.85rem;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
    display: none;
    line-height: 1.4;
}

.auth-alert.error {
    background: rgba(192,57,43,0.2);
    border: 1px solid rgba(192,57,43,0.4);
    color: #e74c3c;
}

.auth-alert.success {
    background: rgba(40,167,69,0.15);
    border: 1px solid rgba(40,167,69,0.35);
    color: #6ee08a;
}

.auth-alert.info {
    background: rgba(41,128,185,0.15);
    border: 1px solid rgba(41,128,185,0.35);
    color: #5dade2;
}

.auth-alert.show { display: block; }

/* ── Success / state panels ── */
.auth-success-state { display: none; text-align: center; }
.auth-success-state.show { display: block; }
.auth-form-state.hide { display: none; }

.success-icon {
    width: 52px;
    height: 52px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-icon svg { width: 26px; height: 26px; fill: #fff; }
.success-icon.red { background: #c0392b; }

.auth-success-state h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: #fff;
    margin: 0 0 0.5rem;
}

.auth-success-state p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.55;
    margin: 0 0 1rem;
}

.auth-success-state p strong { color: rgba(255,255,255,0.85); }

/* Timer bar */
.timer-bar-wrap {
    margin: 0.75rem 0 1rem;
}

.timer-bar-track {
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width 1s linear;
}

.timer-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.3rem;
    text-align: center;
}

/* ── Panel states (reset-password.html) ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── Account page ── */
.account-section {
    min-height: calc(100vh - 250px);
    padding: 2rem 1rem;
    background: var(--header-bg);
}

.account-container {
    max-width: 860px;
    margin: 0 auto;
}

.account-header {
    margin-bottom: 1.5rem;
}

.account-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.2rem;
}

.account-header p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

/* Sidebar + panel layout */
.account-layout {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.account-nav {
    flex: 0 0 155px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 0.5rem 0;
    position: sticky;
    top: 70px;
}

.account-nav-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1.1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
    box-sizing: border-box;
}

.account-nav-item:hover  { color: #6ee08a; background: rgba(255,255,255,0.04); }
.account-nav-item.active { color: #fff; background: rgba(255,255,255,0.08); }

.account-nav-sep {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 0.4rem 0;
}

.account-panels { flex: 1; min-width: 0; }

.account-panel { display: none; }
.account-panel.active { display: block; }

.account-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
}

.account-card:last-child { margin-bottom: 0; }

.account-card-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.9rem;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.info-row:last-child  { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }

.info-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
}

.info-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fff;
}

/* Tier badges */
.tier-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-family: 'DM Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-free     { background: rgba(149,165,166,0.2); color: #bdc3c7; border: 1px solid rgba(149,165,166,0.3); }
.tier-standard { background: rgba(41,128,185,0.2);  color: #5dade2; border: 1px solid rgba(41,128,185,0.3); }
.tier-premium  { background: rgba(243,156,18,0.2);  color: #f5a623; border: 1px solid rgba(243,156,18,0.3); }
.tier-admin    { background: rgba(192,57,43,0.2);   color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }

/* License key */
.license-key-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.license-key-display {
    font-family: 'DM Mono', monospace;
    font-size: 0.88rem;
    color: #fff;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.07);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    flex: 1;
    min-width: 180px;
}

.icon-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.icon-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Profile usage bar */
.profile-bar-wrap { margin-top: 0.5rem; }

.profile-bar-track {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.profile-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--green);
    transition: width 0.5s ease;
}

.profile-bar-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.38);
    margin-top: 0.3rem;
}

/* Sign out panel */
.signout-panel-content {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
}

.signout-panel-content p { margin: 0 0 1.2rem; }

.signout-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.signout-link:hover { color: #6ee08a; }

/* Sign out confirmation overlay */
.signout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--header-bg);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 2rem;
}

.signout-overlay.show { display: flex; }

.signout-overlay h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #fff;
    margin: 1rem 0 0.5rem;
}

.signout-overlay p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

/* Loading overlay */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

#loadingOverlay.hide { opacity: 0; pointer-events: none; }

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Responsive ── */
@media (max-width: 480px) {
    .auth-card { padding: 1.4rem 1.2rem; }
    .account-card { padding: 1rem 1.1rem; }
}

@media (max-width: 600px) {
    .account-layout { flex-direction: column; }
    .account-nav {
        flex: none; width: 100%; position: static;
        display: flex; flex-wrap: wrap; padding: 0.4rem; gap: 0.3rem;
    }
    .account-nav-item {
        flex: 1; min-width: 70px; text-align: center;
        border-radius: 6px; padding: 0.5rem 0.4rem; font-size: 0.78rem;
    }
    .account-nav-sep { display: none; }
}