/**
 * V2 Authentication UI - Glassmorphic Design System
 *
 * A masterpiece of modern authentication design with buttery smooth
 * glass elegance and minimalistic sophistication.
 *
 * Design Philosophy: Apple-inspired glassmorphism meets Westay branding
 *
 * @package V2\Authentication\Views
 * @author UI/UX Design Specialist
 */

/* ========================================================================
   COLOR SYSTEM - WESTAY BRANDING
   ======================================================================== */

:root {
    /* Westay Brand Colors */
    --westay-midnight-voyage: #02243c;
    --westay-riviera-sunrise: #f2444e;
    --westay-vivid-burgundy: #a31a3b;
    --westay-pristine-oceanic: #01d1c1;
    --westay-driftwood: #a47c46;
    --westay-old-money: #285952;
    --westay-white-sand: #f4f4f4;
    --westay-white: #ffffff;

    /* Glass Effect Variables */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(2, 36, 60, 0.1);
    --glass-shadow-hover: rgba(2, 36, 60, 0.2);

    /* Input Glass Effect */
    --input-glass-bg: rgba(255, 255, 255, 0.08);
    --input-glass-border: rgba(255, 255, 255, 0.15);
    --input-glass-focus: rgba(1, 209, 193, 0.3);

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Spacing & Sizing */
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;
}

/* ========================================================================
   GLOBAL RESETS & BASE STYLES
   ======================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--westay-white);
    overflow-x: hidden;
}

/* ========================================================================
   MOUNTAIN BACKGROUND WITH GLASSMORPHIC OVERLAY
   ======================================================================== */

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('../images/4.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Pure white overlay for clean, fresh snow-like background - no moldy green! */
.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0.35) 100%
    );
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1;
}

/* Floating gradient orbs for depth and luxury feel */
.auth-background::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(1, 209, 193, 0.15) 0%,
        transparent 70%
    );
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: floatOrb 15s ease-in-out infinite;
    z-index: 1;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, 50px) scale(1.1); }
}

/* ========================================================================
   LAYOUT CONTAINER
   ======================================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* ========================================================================
   GLASSMORPHIC CARD - "Buttery Smooth Modern Glass Elegance"
   ======================================================================== */

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(1, 209, 193, 0.2);
    border-radius: 16px;
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: 440px;
    padding: 0;
    overflow: hidden;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 12px 48px 0 rgba(31, 38, 135, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   CARD HEADER
   ======================================================================== */

.auth-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: linear-gradient(
        180deg,
        rgba(1, 209, 193, 0.02) 0%,
        transparent 100%
    );
    border-bottom: 1px solid rgba(1, 209, 193, 0.15);
}

.auth-logo {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin-bottom: 32px;
    animation: fadeIn 0.8s ease;
    /* No shadow - seamlessly blends with glass card */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--westay-midnight-voyage);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 16px;
    color: rgba(2, 36, 60, 0.7);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ========================================================================
   CARD BODY
   ======================================================================== */

.auth-body {
    padding: 48px;
}

/* ========================================================================
   ALERTS & MESSAGES
   ======================================================================== */

.auth-alert {
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: slideDown 0.4s ease;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

/* Error Alert */
.auth-alert.error {
    background: rgba(242, 68, 78, 0.1);
    border-color: rgba(242, 68, 78, 0.3);
    color: #c62828;
}

.auth-alert.error::before {
    background: var(--westay-riviera-sunrise);
}

/* Success Alert */
.auth-alert.success {
    background: rgba(1, 209, 193, 0.1);
    border-color: rgba(1, 209, 193, 0.3);
    color: #00695c;
}

.auth-alert.success::before {
    background: var(--westay-pristine-oceanic);
}

/* Warning Alert */
.auth-alert.warning {
    background: rgba(164, 124, 70, 0.1);
    border-color: rgba(164, 124, 70, 0.3);
    color: #6d4c13;
}

.auth-alert.warning::before {
    background: var(--westay-driftwood);
}

/* Info Alert */
.auth-alert.info {
    background: rgba(1, 209, 193, 0.1);
    border-color: rgba(1, 209, 193, 0.2);
    color: #00695c;
}

.auth-alert.info::before {
    background: var(--westay-pristine-oceanic);
}

/* ========================================================================
   FORM ELEMENTS
   ======================================================================== */

.auth-form {
    width: 100%;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

/* Labels with Floating Effect */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--westay-midnight-voyage);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* Input Fields - Glassmorphic with slight opacity for readability */
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--westay-midnight-voyage);
    font-size: 15px;
    font-family: var(--font-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.form-input::placeholder {
    color: rgba(2, 36, 60, 0.4);
}

/* Input Focus State with Pristine Oceanic glow */
.form-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--westay-pristine-oceanic);
    box-shadow:
        0 0 0 3px rgba(1, 209, 193, 0.2),
        0 4px 12px rgba(1, 209, 193, 0.15);
    transform: translateY(-2px);
}

/* Input Error State */
.form-input.error {
    border-color: var(--westay-riviera-sunrise);
    background: rgba(242, 68, 78, 0.08);
}

.form-input.error:focus {
    box-shadow:
        0 0 0 3px rgba(242, 68, 78, 0.2),
        0 4px 12px rgba(242, 68, 78, 0.15);
}

/* Checkbox & Remember Me - Mobile-First Touch Targets (44px minimum) */
.form-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    min-height: 44px; /* Ensure tap target meets mobile standards */
}

.form-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 0; /* Creates 44px tap target */
}

.form-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--westay-pristine-oceanic);
    flex-shrink: 0;
}

.form-checkbox-label {
    font-size: 14px;
    color: rgba(2, 36, 60, 0.7);
    cursor: pointer;
    user-select: none;
}

.form-checkbox:checked + .form-checkbox-label {
    color: var(--westay-midnight-voyage);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-primary);
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Primary Button (Riviera Sunrise → Vivid Burgundy gradient) */
.btn-primary {
    background: linear-gradient(
        135deg,
        var(--westay-riviera-sunrise),
        var(--westay-vivid-burgundy)
    );
    color: var(--westay-white);
    box-shadow:
        0 4px 15px rgba(242, 68, 78, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        var(--westay-vivid-burgundy),
        var(--westay-riviera-sunrise)
    );
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(242, 68, 78, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(242, 68, 78, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Secondary Button (Glass Style) */
.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--glass-border);
    color: var(--westay-midnight-voyage);
    box-shadow: 0 2px 8px var(--glass-shadow);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--glass-shadow-hover);
}

/* Tertiary Button (Pristine Oceanic) */
.btn-tertiary {
    background: var(--westay-pristine-oceanic);
    color: var(--westay-midnight-voyage);
    box-shadow:
        0 4px 12px rgba(1, 209, 193, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-tertiary:hover {
    background: #00bfb1;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(1, 209, 193, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========================================================================
   LINKS
   ======================================================================== */

.auth-link {
    color: var(--westay-pristine-oceanic);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
}

.auth-link:hover {
    color: #00bfb1;
    transform: translateX(2px);
}

/* ========================================================================
   FOOTER / BOTTOM TEXT
   ======================================================================== */

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(1, 209, 193, 0.15);
}

.auth-footer-text {
    font-size: 13px;
    color: rgba(2, 36, 60, 0.5);
    margin-bottom: 8px;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ========================================================================
   PASSWORD STRENGTH INDICATOR
   ======================================================================== */

.password-strength {
    margin-top: 10px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--westay-riviera-sunrise);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--westay-driftwood);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--westay-pristine-oceanic);
}

.password-strength-text {
    font-size: 12px;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================================================
   ANIMATIONS - MICRO-INTERACTIONS
   ======================================================================== */

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Success checkmark animation */
.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--westay-pristine-oceanic);
    stroke-miterlimit: 10;
    margin: 20px auto;
    box-shadow: inset 0px 0px 0px var(--westay-pristine-oceanic);
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--westay-pristine-oceanic);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px var(--westay-pristine-oceanic); }
}

/* ========================================================================
   LOCKOUT MESSAGE CARD
   ======================================================================== */

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

.lockout-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(242, 68, 78, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.lockout-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--westay-midnight-voyage);
    margin-bottom: 12px;
}

.lockout-message {
    font-size: 15px;
    color: rgba(2, 36, 60, 0.8);
    line-height: 1.6;
    margin-bottom: 24px;
}

.lockout-timer {
    font-size: 32px;
    font-weight: 700;
    color: var(--westay-riviera-sunrise);
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .auth-card {
        max-width: 100%;
        border-radius: var(--border-radius);
    }

    .auth-header {
        padding: 32px 32px 24px;
    }

    .auth-body {
        padding: 32px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        border-radius: var(--border-radius-sm);
    }

    .auth-header {
        padding: 24px 24px 20px;
    }

    .auth-body {
        padding: 24px;
    }

    .auth-logo {
        width: 100px;
        margin-bottom: 16px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn {
        padding: 12px 24px;
    }

    .auth-footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--westay-pristine-oceanic);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--westay-white);
    }

    .form-input {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }

    .btn-primary {
        border: 2px solid var(--westay-white);
    }
}

/* ========================================================================
   PRINT STYLES (Hide decorative elements)
   ======================================================================== */

@media print {
    .auth-background,
    .auth-footer,
    .btn-secondary {
        display: none;
    }

    .auth-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
