/* ============================================
   PRESI Auth Pages v1 - Stylesheet
   Consistent with Landing v2 design system
   ============================================ */

:root {
    /* Primary */
    --auth-color-primary: #4A90D9;
    --auth-color-primary-dark: #2E6AB3;
    --auth-color-primary-light: #E8F2FC;

    /* Secondary */
    --auth-color-secondary: #FF7F6B;
    --auth-color-secondary-dark: #E5604A;

    /* Accents */
    --auth-color-accent-mint: #4ECDC4;
    --auth-color-accent-violet: #9B7FD4;

    /* Neutrals */
    --auth-color-text-primary: #2D3436;
    --auth-color-text-secondary: #636E72;
    --auth-color-text-muted: #B2BEC3;
    --auth-color-border: #DFE6E9;
    --auth-color-bg: #F8FAFE;
    --auth-color-surface: #FFFFFF;

    /* Semantic */
    --auth-color-success: #27AE60;
    --auth-color-danger: #E74C3C;
    --auth-color-info: #3498DB;

    /* Gradients */
    --auth-gradient-brand: linear-gradient(135deg, #6c5ce7, #0984e3, #00b894);
    --auth-gradient-btn: linear-gradient(135deg, #4A90D9, #4ECDC4);
    --auth-gradient-btn-hover: linear-gradient(135deg, #2E6AB3, #3CB8B0);

    /* Shadows */
    --auth-shadow-card: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    --auth-shadow-input: 0 1px 3px rgba(45, 52, 54, 0.06);
    --auth-shadow-input-focus: 0 0 0 3px rgba(74, 144, 217, 0.15);
    --auth-shadow-btn: 0 4px 12px rgba(74, 144, 217, 0.3);
    --auth-shadow-btn-hover: 0 6px 20px rgba(74, 144, 217, 0.4);

    /* Border radius */
    --auth-radius-sm: 6px;
    --auth-radius-md: 10px;
    --auth-radius-lg: 16px;
    --auth-radius-full: 9999px;

    /* Transitions */
    --auth-transition: 0.2s ease;
    --auth-transition-slow: 0.4s ease;
}

/* ============================================
   Layout
   ============================================ */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.auth-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: auth-bg-zoom 30s ease-in-out infinite alternate;
}

@keyframes auth-bg-zoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.5), rgba(44, 62, 80, 0.4));
    z-index: 1;
}

/* ============================================
   Card
   ============================================ */

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-card);
    padding: 2.25rem 2rem 2rem;
    animation: auth-card-enter 0.5s ease-out;
}

@keyframes auth-card-enter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Brand / Logo
   ============================================ */

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    transition: transform var(--auth-transition);
}

.auth-brand a:hover {
    transform: scale(1.02);
}

.auth-brand img {
    height: 38px;
    width: auto;
}

.auth-brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--auth-gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* ============================================
   Page Title
   ============================================ */

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-color-text-primary);
    margin: 0 0 0.25rem;
}

.auth-title p {
    font-size: 0.875rem;
    color: var(--auth-color-text-secondary);
    margin: 0;
}

/* ============================================
   Form Elements
   ============================================ */

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label,
.auth-card label[for] {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-color-text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.875rem;
    font-size: 0.9rem;
    color: var(--auth-color-text-primary);
    background: var(--auth-color-surface);
    border: 1.5px solid var(--auth-color-border);
    border-radius: var(--auth-radius-md);
    box-shadow: var(--auth-shadow-input);
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
    outline: none;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
    border-color: var(--auth-color-primary);
    box-shadow: var(--auth-shadow-input-focus);
}

.auth-card input[type="text"]::placeholder,
.auth-card input[type="email"]::placeholder,
.auth-card input[type="password"]::placeholder {
    color: var(--auth-color-text-muted);
}

/* Password toggle container */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--auth-color-text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--auth-transition);
}

.auth-password-toggle:hover {
    color: var(--auth-color-primary);
}

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Checkbox / Remember Me
   ============================================ */

.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1.5px solid var(--auth-color-border);
    accent-color: var(--auth-color-primary);
    cursor: pointer;
}

.auth-checkbox-group label {
    font-size: 0.8125rem;
    color: var(--auth-color-text-secondary);
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
}

/* ============================================
   Buttons
   ============================================ */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: all var(--auth-transition);
    text-decoration: none;
    line-height: 1.4;
}

.auth-btn-primary {
    background: var(--auth-gradient-btn);
    color: white;
    box-shadow: var(--auth-shadow-btn);
}

.auth-btn-primary:hover {
    background: var(--auth-gradient-btn-hover);
    box-shadow: var(--auth-shadow-btn-hover);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--auth-shadow-btn);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.auth-btn .auth-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

.auth-btn.is-loading .auth-btn-spinner {
    display: inline-block;
}

.auth-btn.is-loading .auth-btn-text {
    opacity: 0.7;
}

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

/* ============================================
   Links
   ============================================ */

.auth-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--auth-color-primary);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-color-primary-dark);
    text-decoration: underline;
}

.auth-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.auth-footer-actions--end {
    justify-content: flex-end;
}

/* ============================================
   Divider
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-color-border);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--auth-color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Alerts / Status Messages
   ============================================ */

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-info {
    background: var(--auth-color-primary-light);
    color: var(--auth-color-primary-dark);
    border: 1px solid #bfdbfe;
}

/* ============================================
   Validation Errors
   ============================================ */

.auth-card .text-red-600,
.auth-card .text-sm.text-red-600 {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ============================================
   Register Link / Alternative Action
   ============================================ */

.auth-alt-action {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-color-border);
}

.auth-alt-action p {
    font-size: 0.8125rem;
    color: var(--auth-color-text-secondary);
    margin: 0;
}

.auth-alt-action a {
    font-weight: 600;
    color: var(--auth-color-primary);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-alt-action a:hover {
    color: var(--auth-color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: var(--auth-radius-md);
    }

    .auth-brand-name {
        font-size: 1.25rem;
    }

    .auth-brand img {
        height: 32px;
    }
}

@media (max-height: 700px) {
    .auth-wrapper {
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

/* ============================================
   Dark Mode Support (via data-theme)
   ============================================ */

[data-theme="dark"] .auth-card {
    background: rgba(30, 30, 30, 0.95);
}

[data-theme="dark"] .auth-card input[type="text"],
[data-theme="dark"] .auth-card input[type="email"],
[data-theme="dark"] .auth-card input[type="password"] {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .auth-card label[for] {
    color: #d1d5db;
}
