/* ═══════════════════════════════════════════════════
   login.css — Styles unique to the login/signup page
   Shared base (:root vars, reset, body::before grid)
   comes from app.css
   ═══════════════════════════════════════════════════ */

/* ── BODY — override app.css base with centered grid ── */
body {
    display: grid;
    place-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Ambient glow */
body::after {
    content: '';
    position: fixed;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(232,149,42,0.05) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; z-index: 0;
    animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
    0%,100% { opacity: 0.6; transform: translate(-50%,-50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%,-50%) scale(1.15); }
}

/* ── WRAPPER ── */
.login-wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 400px;
    padding: 20px;
}

/* ── CARD — login card differs from app.css .card ── */
.card {
    background: var(--steel);
    border: 1px solid var(--rivet);
    border-top: 2px solid var(--amber);
    box-shadow:
        0 0 0 1px rgba(232,149,42,0.06),
        0 40px 80px rgba(0,0,0,0.8),
        0 8px 32px rgba(0,0,0,0.5);
    position: relative;
}

/* Bottom corner brackets */
.card::before, .card::after {
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    border-color: var(--amber);
    border-style: solid;
    opacity: 0.3;
}
.card::before { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* Rivet dots */
.rivet {
    position: absolute;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--rivet-hi); border: 1px solid var(--muted);
}
.rivet-tl { top: 10px; left: 12px; }
.rivet-tr { top: 10px; right: 12px; }

/* ── LOGO SECTION ── */
.logo-section {
    padding: 36px 32px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--rivet);
    background: var(--steel-mid);
    position: relative;
}

.login-logo {
    width: 128px; height: 128px;
    margin: 0 auto;
    flex-shrink: 0;
}
.login-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.logo-wordmark {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.logo-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px; letter-spacing: 0.12em; color: var(--white);
    line-height: 1;
}
.logo-name span { color: var(--amber); }
.logo-tm {
    font-family: 'Barlow', sans-serif;
    font-size: 11px; font-weight: 400;
    vertical-align: super; letter-spacing: 0;
    color: var(--muted);
}
.logo-tagline {
    font-family: 'DM Mono', monospace;
    font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
    color: var(--muted);
}

/* ── TABS ── */
.tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--rivet);
}
.tab {
    padding: 12px 20px;
    font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted); cursor: pointer; text-align: center;
    border-right: 1px solid var(--rivet);
    transition: all 0.2s;
    background: transparent;
    user-select: none;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--text-hi); background: rgba(255,255,255,0.02); }
.tab.active {
    color: var(--amber);
    background: var(--amber-dim);
    border-bottom: 2px solid var(--amber);
    margin-bottom: -1px;
}

/* ── ERROR DISPLAY ── */
#error-cypher {
    display: none;
    padding: 10px 28px;
    font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 0.08em;
    line-height: 1.5;
}

/* ── FORM PANELS ── */
.form-panel { display: none; }
.form-panel.active { display: block; }

/* ── FORM BODY ── */
.form-body { padding: 24px 28px 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }

/* Two-column row (signup name + company) */
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-row .field { margin-bottom: 0; }

.field-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
}

.field-input {
    background: var(--input-bg);
    border: 1px solid var(--rivet);
    border-top: 1px solid var(--rivet-hi);
    padding: 12px 14px;
    color: var(--white); font-size: 14px;
    font-family: 'Barlow', sans-serif;
    outline: none; width: 100%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.02em;
    border-radius: 0;
}
.field-input:focus {
    border-color: var(--amber);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5),
                0 0 0 1px rgba(232,149,42,0.2);
}
.field-input::placeholder { color: var(--muted); }

/* ── PASSWORD WRAPPER ── */
.pw-wrap { position: relative; }
.pw-toggle {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: none;
    color: var(--muted); cursor: pointer;
    padding: 0; line-height: 1;
    transition: color 0.2s;
    opacity: 0.5;
    border-radius: 0;
    min-height: unset;
    box-shadow: none;
}
.pw-toggle:hover { color: var(--text-hi); opacity: 1; }
.pw-toggle svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    display: block;
}
.pw-toggle line { stroke: currentColor; }

/* ── REMEMBER ME ── */
.remember-row {
    display: flex; align-items: center; gap: 10px;
    margin: 16px 0 0;
}
.remember-check {
    width: 16px; height: 16px;
    background: var(--input-bg);
    border: 1px solid var(--rivet);
    display: grid; place-items: center;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.2s;
    border-radius: 0;
}
.remember-check.checked {
    background: var(--amber-dim);
    border-color: var(--amber-line);
}
.remember-check-inner {
    width: 8px; height: 8px;
    background: var(--amber);
    opacity: 0; transition: opacity 0.15s;
}
.remember-check.checked .remember-check-inner { opacity: 1; }
.remember-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted); cursor: pointer; user-select: none;
}

/* ── TERMS CHECKBOX ROW ── */
.terms-label {
    display: flex; align-items: flex-start; gap: 8px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); line-height: 1.6;
}
.terms-label input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0;
    accent-color: var(--amber);
}

/* ── FORM FOOTER ── */
.form-footer {
    padding: 12px 28px 28px;
    display: flex; flex-direction: column; gap: 12px;
}

/* ── PRIMARY BUTTON — login-specific full-width with shimmer ── */
.btn-primary {
    width: 100%; padding: 14px;
    background: var(--amber); border: 1px solid var(--amber);
    color: #000; font-family: 'DM Mono', monospace;
    font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 0 24px rgba(232,149,42,0.3);
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 0; min-height: unset;
}
.btn-primary:hover {
    background: #f0a030;
    box-shadow: 0 0 36px rgba(232,149,42,0.5);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: 0.7; cursor: not-allowed; transform: none;
}

/* Scanline shimmer on hover */
.btn-primary::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s;
}
.btn-primary:hover::after { left: 140%; }

/* Loading state inside button */
.loading-cipher-state {
    display: none;
    align-items: center; justify-content: center; gap: 8px;
    font-size: 12px; letter-spacing: 0.14em;
}
.cipher-spinner {
    width: 12px; height: 12px;
    border: 2px solid rgba(0,0,0,0.25);
    border-top-color: #000;
    border-radius: 50%;
    animation: cipher-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes cipher-spin { to { transform: rotate(360deg); } }

/* ── FORGOT LINK ── */
.forgot-link {
    text-align: center;
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted); cursor: pointer;
    transition: color 0.2s;
    background: transparent; border: none;
    padding: 0; width: 100%;
    border-radius: 0; min-height: unset; box-shadow: none;
}
.forgot-link:hover { color: var(--amber); }

/* ── CIPHER LINK ── */
.cipher-link {
    color: var(--amber); text-decoration: none;
    transition: opacity 0.2s;
}
.cipher-link:hover { opacity: 0.75; }

/* ── DIVIDER ── */
.divider {
    display: flex; align-items: center; gap: 12px;
}
.divider-line {
    flex: 1; height: 1px; background: var(--rivet);
}
.divider-text {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.2em; color: var(--muted);
    text-transform: uppercase;
}

/* ── DEMO BUTTON ── */
.btn-demo {
    width: 100%; padding: 12px;
    background: transparent; border: 1px solid var(--rivet);
    color: var(--muted); font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 0; min-height: unset; box-shadow: none;
}
.btn-demo:hover {
    border-color: var(--amber-line);
    color: var(--text-hi);
    background: var(--amber-dim);
}
.demo-arrow { transition: transform 0.2s; }
.btn-demo:hover .demo-arrow { transform: translateX(3px); }

/* ── CARD FOOTER ── */
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--rivet);
    background: var(--steel-mid);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.footer-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--amber); opacity: 0.5;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%,100% { opacity: 0.4; }
    50% { opacity: 0.9; box-shadow: 0 0 6px rgba(232,149,42,0.6); }
}
.footer-text {
    font-family: 'DM Mono', monospace;
    font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted);
}

/* ── VERSION STRIP ── */
.version-strip {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0 0;
}
.version-text {
    font-family: 'DM Mono', monospace;
    font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--rivet-hi);
}

/* =====================================================
   MODAL BASE — shared by reset + payment modals
   ===================================================== */
.cipher-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(4px);
}
.cipher-modal-content {
    background: var(--steel);
    border: 1px solid var(--rivet);
    border-top: 2px solid var(--amber);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    max-width: 480px; width: 90%;
    position: relative;
}
.cipher-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--rivet);
}
.cipher-modal-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px; letter-spacing: 0.08em; color: var(--white);
}
.cipher-modal-close {
    background: transparent; border: 1px solid var(--rivet);
    color: var(--muted); cursor: pointer;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    font-size: 18px; line-height: 1;
    transition: all 0.2s; border-radius: 0;
    min-height: unset; box-shadow: none;
}
.cipher-modal-close:hover { border-color: var(--rivet-hi); color: var(--text-hi); }
.cipher-modal-body { padding: 24px 24px 28px; }

/* ── FORM ELEMENTS inside modals ── */
.form-cipher-group {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 14px;
}
.form-cipher-group:last-child { margin-bottom: 0; }
.form-cipher-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
}
.form-cipher-input {
    background: var(--input-bg);
    border: 1px solid var(--rivet);
    border-top: 1px solid var(--rivet-hi);
    padding: 10px 14px;
    color: var(--white); font-size: 14px;
    font-family: 'Barlow', sans-serif;
    outline: none; width: 100%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    transition: border-color 0.2s; border-radius: 0;
}
.form-cipher-input:focus {
    border-color: var(--amber);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 0 0 1px rgba(232,149,42,0.2);
}
.form-cipher-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-cipher-checkbox {
    display: flex; align-items: flex-start; gap: 8px;
    cursor: pointer; font-size: 13px; color: var(--text-hi); line-height: 1.5;
}
.form-cipher-checkbox input { accent-color: var(--amber); margin-top: 2px; }

/* Primary button in modals */
.cipher-btn--primary.cipher-btn--full {
    width: 100%; margin-top: 16px; padding: 13px;
    background: var(--amber); border: 1px solid var(--amber);
    color: #000; font-family: 'DM Mono', monospace;
    font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 0 20px rgba(232,149,42,0.25);
    border-radius: 0; min-height: unset; display: block;
}
.cipher-btn--primary.cipher-btn--full:hover {
    background: #f0a030; box-shadow: 0 0 32px rgba(232,149,42,0.4);
}

/* Reset message */
.reset-message {
    margin-top: 14px;
    font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 0.1em;
    text-align: center; min-height: 18px;
}
.reset-message.is-error  { color: #e05555; }
.reset-message.is-success { color: #4caf6e; }

/* ── PAYMENT MODAL ── */
.payment-cipher-options { margin: 18px 0; }
.payment-cipher-options h3 {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--amber); margin-bottom: 10px;
}
.payment-cipher-tabs {
    display: flex; border: 1px solid var(--rivet); margin-bottom: 14px;
}
.payment-tab {
    flex: 1; padding: 10px;
    background: transparent; border: none; border-right: 1px solid var(--rivet);
    color: var(--muted); cursor: pointer;
    font-family: 'DM Mono', monospace; font-size: 11px;
    letter-spacing: 0.1em; text-transform: uppercase; transition: all 0.2s;
    border-radius: 0; min-height: unset; box-shadow: none;
}
.payment-tab:last-child { border-right: none; }
.payment-tab.active { background: var(--amber-dim); color: var(--amber); }
.payment-cipher-method { display: none; }
.payment-cipher-method.active { display: block; }
.pricing-cipher-summary {
    background: var(--steel-mid); border: 1px solid var(--rivet);
    padding: 14px 18px; margin: 18px 0;
}
.price-row {
    display: flex; justify-content: space-between;
    font-family: 'DM Mono', monospace; font-size: 11px;
    letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px;
}
.price-row.total {
    color: var(--text-hi); padding-top: 10px;
    border-top: 1px solid var(--rivet); margin-bottom: 0;
}
.price-row .price { color: var(--amber); }
.trial-info {
    font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center;
}
.paypal-cipher-info { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.paypal-icon { font-size: 32px; margin-bottom: 10px; }
.paypal-benefits { display: flex; gap: 14px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.paypal-benefits span {
    font-family: 'DM Mono', monospace; font-size: 10px; color: var(--amber);
}

/* ── LEGAL MODALS ── */
.legal-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(4px);
}
.legal-modal-content {
    background: var(--steel);
    border: 1px solid var(--rivet);
    border-top: 2px solid var(--amber);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    max-width: 560px; width: 90%;
    max-height: 80vh; overflow-y: auto;
}
.legal-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--rivet);
    position: sticky; top: 0; background: var(--steel); z-index: 1;
}
.legal-modal-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px; letter-spacing: 0.08em; color: var(--white);
}
.legal-modal-close {
    background: transparent; border: 1px solid var(--rivet);
    color: var(--muted); cursor: pointer;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    font-size: 18px; transition: all 0.2s;
    border-radius: 0; min-height: unset; box-shadow: none;
}
.legal-modal-close:hover { border-color: var(--rivet-hi); color: var(--text-hi); }
.legal-modal-body {
    padding: 24px 24px 28px;
    color: var(--text-hi); font-size: 13px; line-height: 1.7;
}
.legal-modal-body h3 {
    font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--amber); margin: 20px 0 8px;
}
.legal-modal-body h3:first-child { margin-top: 0; }
.legal-modal-body p { color: var(--muted); margin-bottom: 10px; }
.legal-modal-body strong { color: var(--text-hi); }

/* ── DEMO TIMER ── */
.demo-cipher-timer {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%);
    background: var(--steel-mid);
    border: 1px solid var(--rivet);
    border-left: 3px solid var(--amber);
    padding: 10px 20px; z-index: 8000;
    white-space: nowrap;
}
.timer-content {
    display: flex; align-items: center; gap: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
}
.timer-countdown { color: var(--amber); }
.timer-upgrade-btn {
    padding: 6px 16px; background: var(--amber); color: #000;
    border: none; cursor: pointer; font-family: 'DM Mono', monospace;
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 600; transition: background 0.2s;
    border-radius: 0; min-height: unset; box-shadow: none;
}
.timer-upgrade-btn:hover { background: #f0a030; }
