/* =====================================================
   AUTH PAGES (login, register, renew, admin login)
   Uses theme.css variables only - no hardcoded colors
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

input, select, textarea, button, th, td, p, a, h1, h2, h3, legend, label {
    font-family: inherit;
}

/* =====================================================
   SCANLINES & NOISE
   ===================================================== */

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
}

/* =====================================================
   HAMBURGER MENU
   ===================================================== */

.menu-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2001;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0.6rem;
    transition: all 0.3s ease;
    width: auto;
    max-width: none;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    display: block;
}

.menu-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.menu-toggle:hover span {
    background: var(--bg-primary);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =====================================================
   SLIDE-IN MENU
   ===================================================== */

.slide-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-color);
    z-index: 2000;
    padding: 5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-menu);
}

.slide-menu.active {
    right: 0;
}

.menu-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 0.2rem;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.slide-menu .menu-btn-item {
    width: 100%;
    padding: 1rem;
    background: var(--btn-bg);
    border: 2px solid var(--btn-border);
    border-radius: 2px;
    color: var(--btn-text);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: block;
    white-space: nowrap;
    max-width: none;
}

.slide-menu .menu-btn-item:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

/* =====================================================
   AUTH CARD
   ===================================================== */

.auth-card {
    background: var(--bg-secondary);
    border-radius: 2px;
    max-width: 400px;
    width: 100%;
    padding: 2.5rem;
}

.auth-card h2 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-card .form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.auth-card .group-field {
    margin-bottom: 4px;
}

/* =====================================================
   FORM INPUTS
   ===================================================== */

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.75rem;
    width: 100%;
    transition: border-color 0.2s ease;
    outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: var(--text-tertiary);
}

input[type="text"]:hover:not(:disabled),
input[type="password"]:hover:not(:disabled),
input[type="email"]:hover:not(:disabled),
select:hover:not(:disabled) {
    border-color: var(--text-secondary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: var(--accent-primary);
}

input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
select:disabled {
    background: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Override browser autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    caret-color: var(--text-primary);
    transition: background-color 5000s ease-in-out 0s;
}

/* =====================================================
   AUTH BUTTON
   ===================================================== */

button {
    background: var(--btn-bg);
    border: 2px solid var(--btn-border);
    border-radius: 2px;
    color: var(--btn-text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    text-align: center;
    width: 100%;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================================================
   AUTH FOOTER LINK
   ===================================================== */

.auth-footer-link {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    margin-left: 0.25rem;
}

.auth-link:hover {
    color: var(--accent-secondary);
}

/* =====================================================
   REGISTER MODE TOGGLE
   ===================================================== */

.register-mode {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.register-mode button {
    width: calc(50% - 6px);
    opacity: 0.6;
}

.register-mode button.active {
    opacity: 1;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.register-mode button:hover:not(.active) {
    opacity: 0.8;
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    border-radius: 2px;
    margin-bottom: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-success);
}

.alert-warning {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-error);
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
}

.footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
        max-width: 100%;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        font-size: 0.8rem;
        padding: 0.6rem;
    }

    button {
        font-size: 0.7rem;
        padding: 0.7rem;
    }
}

@media (min-width: 390px) {
    body {
        padding: 1.5rem;
    }
}
