/* ===== SCALEUP AUTH DESIGN ===== */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'DM Sans', sans-serif;
    background: #050d14;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    /* No padding on mobile — card fills full width */
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Add padding back only on larger screens */
@media (min-width: 520px) {
    body {
        padding: 32px 24px;
    }
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed; /* fixed so it doesn't scroll on mobile */
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 114, 255, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 198, 255, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 60% 30%, rgba(0, 50, 120, 0.15) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed; /* fixed so grid doesn't scroll */
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 198, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 198, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* ===== CONTAINER ===== */
.auth-container {
    position: relative;
    z-index: 1;
    /* Full width + full height on mobile, card style on desktop */
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 48px 28px 40px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    color: #fff;
}

/* On desktop: restore card style */
@media (min-width: 520px) {
    .auth-container {
        width: 420px;
        min-height: unset;
        display: block;
        padding: 44px 40px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.09);
        box-shadow:
            0 0 0 1px rgba(0, 198, 255, 0.08),
            0 20px 60px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* ===== LOGO ===== */
.auth-logo {
    text-align: center;
    margin-bottom: clamp(16px, 4vw, 24px);
}

.auth-logo img {
    width: clamp(100px, 38vw, 160px);
    height: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: clamp(10px, 2.5vw, 14px) clamp(16px, 5vw, 26px);
    border: none;
    box-shadow:
        0 0 0 3px rgba(0, 198, 255, 0.35),
        0 8px 32px rgba(0, 0, 0, 0.5);
    display: inline-block;
}

/* ===== HEADINGS ===== */
.auth-container h2 {
    text-align: center;
    margin-bottom: clamp(20px, 5vw, 28px);
    font-weight: 700;
    font-size: clamp(17px, 4.5vw, 22px);
    letter-spacing: 0.5px;
    color: #ffffff;
}

.auth-container h2::after {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    border-radius: 2px;
    margin: 8px auto 0;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: clamp(14px, 3.5vw, 18px);
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: clamp(11px, 2.8vw, 12px);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* ===== INPUTS & SELECT ===== */
.form-group input,
.form-group select {
    width: 100%;
    /* min 44px height for accessible touch targets */
    padding: clamp(11px, 2.8vw, 12px) clamp(12px, 3vw, 14px);
    min-height: 44px;
    border-radius: 10px;
    outline: none;
    font-size: 16px; /* 16px prevents iOS zoom-on-focus */
    font-family: 'DM Sans', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    appearance: none;
    -webkit-appearance: none;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    /* Prevent text resize on orientation change */
    -webkit-text-size-adjust: 100%;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* SELECT: custom arrow */
.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group select option {
    background-color: #0d1f2d;
    color: #ffffff;
}

/* Focus */
.form-group input:focus,
.form-group select:focus {
    border-color: rgba(0, 198, 255, 0.5);
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.12);
}

/* ===== BUTTON ===== */
button[type="submit"],
button {
    width: 100%;
    padding: clamp(13px, 3.2vw, 14px);
    min-height: 48px; /* accessible touch target */
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
    color: #fff;
    font-size: clamp(14px, 3.5vw, 15px);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    margin-top: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    position: relative;
    overflow: hidden;
    /* Prevent double-tap zoom on mobile */
    touch-action: manipulation;
}

button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s ease;
}

/* Only apply hover lift on pointer devices (not touch) */
@media (hover: hover) and (pointer: fine) {
    button:hover::before {
        left: 100%;
    }

    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 114, 255, 0.45);
    }
}

button:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* ===== FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: clamp(16px, 4vw, 20px);
    font-size: clamp(12px, 3vw, 13px);
    color: rgba(255, 255, 255, 0.45);
}

.auth-footer a {
    color: #00c6ff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    /* Larger tap area without visual change */
    padding: 4px 0;
    display: inline-block;
}

.auth-footer a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ===== MESSAGES ===== */
.auth-message {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: clamp(12px, 3vw, 13px);
    font-weight: 500;
}

.auth-error {
    background: rgba(255, 77, 77, 0.18);
    border: 1px solid rgba(255, 77, 77, 0.35);
    color: #ff8080;
}

.auth-success {
    background: rgba(40, 167, 69, 0.18);
    border: 1px solid rgba(40, 167, 69, 0.35);
    color: #5dd87a;
}

/* Inline success/error (from PHP style attributes) */
[style*="background:#28a745"] {
    background: rgba(40, 167, 69, 0.18) !important;
    border: 1px solid rgba(40, 167, 69, 0.35) !important;
    color: #5dd87a !important;
}

[style*="background:#ff4d4d"] {
    background: rgba(255, 77, 77, 0.18) !important;
    border: 1px solid rgba(255, 77, 77, 0.35) !important;
    color: #ff8080 !important;
}

/* ===== LANDSCAPE MOBILE ===== */
/* Short screens in landscape (e.g. iPhone SE rotated) */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .auth-logo {
        margin-bottom: 12px;
    }

    .auth-logo img {
        width: 90px;
    }

    .auth-container h2 {
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 10px;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    button,
    button::before,
    .form-group input,
    .form-group select,
    .auth-footer a {
        transition: none;
    }
}