@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Mobile specific */
    -webkit-touch-callout: none;
}

/* Allow selection only for input fields */
input,
textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Disable right-click context menu */
body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Disable image dragging */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Prevent long-press menu on mobile */
* {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
}

input,
textarea,
[contenteditable="true"] {
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
}

:root {
    --primary:        #3b6ef8;
    --primary-dark:   #2563eb;
    --primary-end:    #1d4ed8;
    --success:        #16a34a;
    --error:          #ef4444;
    --text-primary:   #111111;
    --text-secondary: #666666;
    --text-muted:     #999999;
    --bg:             #ffffff;
    --bg-soft:        #fafafa;
    --border:         #eeeeee;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ─── Base ─────────────────────────────────────────── */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #ffffff;
    background-image: 
        radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 24px 24px;
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Background Decoration */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* ─── Layout ────────────────────────────────────────── */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    z-index: 1;
}

/* ─── Card ──────────────────────────────────────────── */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.04),
        0 1px 4px rgba(0, 0, 0, 0.02);
}

/* ─── Premium Auth Banner (Nano 2.5 Pro Style) ───────────────── */
.auth-banner {
    border-radius: 24px 24px 0 0;
    padding: 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin: -40px -32px 30px -32px;
    height: 200px; /* Taller for better impact */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(59, 110, 248, 0.3);
    border-bottom: 2px solid rgba(59, 110, 248, 0.3);
}

.banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transform: scale(1.1); /* Subtle zoom for depth */
    filter: brightness(0.9);
}

.auth-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(12px); /* Even stronger blur for better look */
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-banner h2 {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.auth-banner p {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Glow effect at bottom */
.auth-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b6ef8, transparent);
    box-shadow: 0 0 15px #3b6ef8;
    z-index: 3;
}

/* ─── Header ────────────────────────────────────────── */
.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-flame {
    font-size: 28px;
    line-height: 1;
}

.logo-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

/* ─── Form ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 8px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background: var(--bg-soft);
    transition: all 0.2s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 110, 248, 0.1);
}

.form-group input.invalid {
    border-color: var(--error);
    background: #fff5f5;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Error message */
.error-message {
    display: block;
    color: var(--error);
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    min-height: 18px;
}

/* ─── Form Options ──────────────────────────────────── */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ─── Button ────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 110, 248, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.loading .btn-text { display: none; }
.loading .btn-loader { display: inline-flex !important; }

/* ─── Alert ─────────────────────────────────────────── */
.alert {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ─── Footer ────────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ─── Mobile (< 600px) ──────────────────────────────── */
@media (max-width: 599px) {
    .container {
        padding: 16px;
    }

    .login-box {
        padding: 30px 20px;
    }

    .auth-banner {
        margin: -30px -20px 24px -20px;
        padding: 30px 20px;
        border-radius: 24px 24px 0 0;
    }

    .login-header h1 {
        font-size: 20px;
    }

    .form-group input {
        font-size: 16px; /* prevents iOS zoom */
    }
}

/* ─── Accessibility ─────────────────────────────────── */
*:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.1);
    outline-offset: 2px;
}
