/**
 * Auth Styles - Login, Esqueci minha senha, Cadastro
 * Regal SaaS Platform v3.0 — Premium Auth Design
 * Uses design-system.css tokens
 */

/* ============================================
   1. RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
}

/* ============================================
   2. SPLIT-SCREEN WRAPPER
   ============================================ */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================
   3. LEFT PANEL — Brand / Hero
   ============================================ */
.login-left {
    flex: 0 0 44%;
    max-width: 44%;
    background: linear-gradient(160deg, var(--primary) 0%, #8b1a12 60%, #5c100b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

/* Subtle cross-hatch / geometric pattern overlay */
.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        /* Cross '+' pattern */
        url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Crect x='18' y='8' width='4' height='24' rx='1'/%3E%3Crect x='8' y='18' width='24' height='4' rx='1'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Soft radial glow for depth */
.login-left::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -30%;
    width: 100%;
    height: 140%;
    background: radial-gradient(ellipse at 70% 30%, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-brand {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
    max-width: 280px;
}

.login-brand .auth-logo {
    display: block;
    width: 160px;
    max-width: 100%;
    max-height: 56px;
    object-fit: contain;
    margin: 0 auto 20px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.login-brand p {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin: 0;
}

/* ============================================
   4. RIGHT PANEL — Form area
   ============================================ */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Subtle dot-grid background for the form side */
.login-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   5. FORM CONTAINER (Login pages with inline form)
   ============================================ */
.login-form-container {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.login-form-container h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.login-form-container .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.5;
    font-weight: 400;
}

/* ============================================
   6. AUTH CARD (Esqueci senha, Cadastro, Reset)
   ============================================ */
.auth-card,
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.auth-card-header,
.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.auth-card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   7. FORM ELEMENTS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.form-input::placeholder {
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ============================================
   8. BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--primary);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-top: 10px;
    width: 100%;
    font-size: 14px;
    padding: 11px 24px;
}

.btn-ghost:hover,
.btn-ghost:focus {
    background: rgba(var(--primary-rgb), 0.04);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
    transform: translateY(-1px);
    outline: none;
}

.btn-ghost:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-ghost:focus-visible,
.btn-primary:focus-visible,
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18);
}

/* Size variants */
.btn-full { width: 100%; }
.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ============================================
   9. ALERTS
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert p {
    margin: 0;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    text-align: center;
}

.alert-stack {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex: 0 0 44px;
}

.alert-icon-success {
    background: var(--success);
    margin: 0 auto 12px;
}

.alert-icon-error {
    background: #dc2626;
}

.alert-link {
    display: inline-block;
    margin-top: 8px;
    color: #991b1b;
    font-weight: 600;
    text-decoration: underline;
}

/* ============================================
   10. FORM LINKS & DIVIDER
   ============================================ */
.form-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Standalone text link inside login-form-container */
.login-form-container .text-secondary,
.login-form-container a.text-secondary {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s;
}

.login-form-container .text-secondary:hover,
.login-form-container a.text-secondary:hover {
    color: var(--primary);
}

/* mt-lg utility used on sysop login */
.mt-lg {
    margin-top: 20px;
}

.text-center {
    text-align: center;
}

/* ============================================
   11. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .login-left {
        flex: 0 0 38%;
        max-width: 38%;
        padding: 48px 32px;
    }

    .login-right {
        padding: 48px 32px;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        flex: none;
        max-width: 100%;
        min-height: 180px;
        padding: 32px 24px;
    }

    .login-brand .auth-logo {
        width: 120px;
        max-height: 40px;
        margin-bottom: 12px;
    }

    .login-brand p {
        font-size: 12px;
    }

    .login-right {
        padding: 32px 20px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .login-form-container h2 {
        font-size: 22px;
    }

    .login-form-container .subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .login-left {
        min-height: 140px;
        padding: 24px 16px;
    }

    .login-right {
        padding: 24px 16px;
    }

    .auth-card {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .login-form-container {
        max-width: 100%;
        padding: 24px 16px;
        border-radius: 12px;
    }
}
