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

:root {
    /* Biru Commerce */
    --auth-color-primary: #0057A8;
    --auth-color-primary-dark: #003F7A;
    --auth-color-primary-light: rgba(230, 240, 250, 0.55);

    /* Secondary */
    --auth-color-secondary: #C9A227;
    --auth-color-secondary-dark: #A8861C;

    /* Accents */
    --auth-color-accent-mint: #2BBBAD;
    --auth-color-accent-violet: #3D5A80;

    /* Neutrals — tuned for glass over dark wallpaper */
    --auth-color-text-primary: #0F1C2E;
    --auth-color-text-secondary: #3d4f63;
    --auth-color-text-muted: #6b7a8d;
    --auth-color-border: rgba(255, 255, 255, 0.45);
    --auth-color-bg: #060a12;
    --auth-color-surface: rgba(255, 255, 255, 0.55);

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

    /* Gradients */
    --auth-gradient-brand: linear-gradient(135deg, #003F7A, #0057A8 45%, #1A7AD9);
    --auth-gradient-btn: linear-gradient(135deg, #0057A8, #1A7AD9);
    --auth-gradient-btn-hover: linear-gradient(135deg, #003F7A, #0057A8);

    /* Shadows */
    --auth-shadow-card: 0 24px 64px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    --auth-shadow-input: 0 1px 2px rgba(15, 28, 46, 0.06);
    --auth-shadow-input-focus: 0 0 0 3px rgba(0, 87, 168, 0.22);
    --auth-shadow-btn: 0 8px 22px rgba(0, 87, 168, 0.4);
    --auth-shadow-btn-hover: 0 12px 28px rgba(0, 87, 168, 0.5);

    /* Border radius */
    --auth-radius-sm: 6px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 20px;
    --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:
        radial-gradient(ellipse 70% 60% at 70% 40%, rgba(0, 87, 168, 0.28) 0%, transparent 55%),
        linear-gradient(135deg, rgba(6, 10, 18, 0.45) 0%, rgba(0, 63, 122, 0.35) 50%, rgba(6, 10, 18, 0.5) 100%);
    z-index: 1;
}

/* ============================================
   Card — glassmorphism
   ============================================ */

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    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;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.02) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

@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: 72px;
    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: #fff;
    margin: 0 0 0.25rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.auth-title p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.78);
    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: rgba(255, 255, 255, 0.92);
    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: #0F1C2E;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--auth-radius-md);
    box-shadow: var(--auth-shadow-input);
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition), background 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: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.72);
    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: rgba(15, 28, 46, 0.45);
}

/* 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: rgba(15, 28, 46, 0.5);
    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: rgba(255, 255, 255, 0.8);
    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: 600;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
    transition: color var(--auth-transition), opacity var(--auth-transition);
}

.auth-link:hover {
    color: #fff;
    opacity: 0.85;
    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: rgba(255, 255, 255, 0.25);
}

.auth-divider span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    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;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-alert-success {
    background: rgba(236, 253, 245, 0.75);
    color: #065f46;
    border: 1px solid rgba(167, 243, 208, 0.7);
}

.auth-alert-danger {
    background: rgba(254, 242, 242, 0.75);
    color: #991b1b;
    border: 1px solid rgba(254, 202, 202, 0.7);
}

.auth-alert-info {
    background: rgba(230, 240, 250, 0.7);
    color: #003F7A;
    border: 1px solid rgba(191, 219, 254, 0.7);
}

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

.auth-card .text-red-600,
.auth-card .text-sm.text-red-600 {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 600;
    color: #fecaca !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

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

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

.auth-alt-action p {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.auth-alt-action a {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: opacity var(--auth-transition);
}

.auth-alt-action a:hover {
    color: #fff;
    opacity: 0.85;
    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: 56px;
    }
}

@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;
}

/* Wide card variant (e.g. school registration) */
.auth-card.auth-card-wide {
    max-width: 580px;
}
