/* Global Reset & Base Variables */
:root {
    --bg-dark: #0a0c10;
    --card-bg: rgba(18, 22, 31, 0.65);
    --card-border: rgba(255, 255, 255, 0.06);
    --accent-blue: #0072ff;
    --accent-cyan: #00d2ff;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --input-bg: rgba(10, 12, 16, 0.7);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus: rgba(0, 210, 255, 0.3);
    --error-red: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Screen reader shortcut utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Background Premium Atmosphere Layer */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #111622 0%, #0a0c10 100%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    pointer-events: none;
}

.orb-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-blue);
}

.orb-2 {
    bottom: -15%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-cyan);
}

.light-streak {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.05), transparent);
    transform: rotate(-25deg);
    pointer-events: none;
}

.streak-1 {
    top: 20%;
    left: -20%;
    width: 150%;
    height: 80px;
}

.streak-2 {
    bottom: 15%;
    right: -20%;
    width: 140%;
    height: 40px;
}

/* Micro-water droplets aesthetic layer using a crisp inline SVG pattern */
.water-drops {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.025;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Ccircle cx='10' cy='20' r='1.5' fill='%23fff'/%3E%3Ccircle cx='45' cy='15' r='1' fill='%23fff'/%3E%3Ccircle cx='65' cy='55' r='2' fill='%23fff'/%3E%3Ccircle cx='25' cy='60' r='1.2' fill='%23fff'/%3E%3C/svg%3E");
}

/* Layout Wrapper */
.login-wrapper {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-top: calc(24px + env(safe-area-inset-top));
}

/* Premium Card Glassmorphism Architecture */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 80px rgba(0, 114, 255, 0.03);
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Header Config */
.card-header {
    text-align: center;
    margin-bottom: 36px;
}

.card-header h1 {
    font-size: 33px;          /* Increased from 28px to 38px */
    font-weight: 700;          /* Boosted font weight for a bolder, premium look */
    letter-spacing: 0.5px;       /* Adds professional premium tracking spacing */
    color: var(--text-main);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1); /* Subtle glowing depth */
}

.card-header p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Forms & UI Inputs Controls */
.form-group {
    margin-bottom: 20px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    color: #556075;
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.left-icon {
    left: 16px;
}

.input-container input {
    width: 100%;
    height: 52px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0 16px 0 48px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 400;
    outline: none;
    transition: var(--transition-smooth);
}

.input-container input[type="password"] {
    padding-right: 48px;
}

/* Focus and Filled Interaction Behaviors */
.input-container input:focus {
    border-color: rgba(0, 210, 255, 0.5);
    background-color: rgba(14, 18, 27, 0.9);
    box-shadow: 0 0 0 4px var(--input-focus);
}

.input-container input:focus + .left-icon,
.input-container input:not(:placeholder-shown) + .left-icon {
    color: var(--accent-cyan);
}

.right-icon-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #556075;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.right-icon-btn:hover {
    color: var(--text-main);
}

.right-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Form Actions Utility Items */
.form-utilities {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 32px;
    font-size: 14px;
}

/* Premium Checkbox Component styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    transition: var(--transition-smooth);
}

.checkbox-label:hover input ~ .custom-checkbox {
    border-color: rgba(0, 210, 255, 0.4);
}

.checkbox-label input:checked ~ .custom-checkbox {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border-color: transparent;
}

.custom-checkbox::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .custom-checkbox::after {
    display: block;
}

.label-text {
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.checkbox-label:hover .label-text {
    color: var(--text-main);
}

.forgot-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.forgot-link:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

/* Premium Action Button Configuration */
.btn-primary {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 114, 255, 0.25);
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease, filter 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 210, 255, 0.4), 0 0 15px rgba(0, 114, 255, 0.2);
    filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Alert / Clean Notification banner */
.alert-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #fca5a5;
    font-size: 14px;
    animation: fadeIn 0.3s ease forwards;
}

.alert-icon {
    width: 18px;
    height: 18px;
    color: var(--error-red);
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Spinner Element Engineering */
.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

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

/* Responsive Structural Engineering Layout breakpoints */
/* Locate this block at the very bottom of your login.css file */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 16px;
    }
    
    .login-card {
        padding: 36px 24px;
        border-radius: var(--radius-md);
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    }
    
    /* UPDATE THIS BLOCK TO MATCH THESE PREMIUM MOBILE SIZES */
    .card-header h1 {
        font-size: 32px;         /* Increased from 24px so it stays big on iPhone */
        font-weight: 700;        /* Bold appearance */
        letter-spacing: 0.5px;   /* Tightened slightly for small screen viewports */
        line-height: 1.2;        /* Prevents text overlaps if it wraps */
    }
    
    .input-container input {
        height: 50px;
        font-size: 16px; /* Essential: Prevents automatic iOS Safari page zooming on focus */
    }
    
    .btn-primary {
        height: 50px;
        font-size: 16px;
    }
}
