/* ===============================
   Theme Variables
================================ */

:root {
    --bg: linear-gradient(135deg, #667eea, #764ba2);
    --card-bg: rgba(255, 255, 255, 0.15);
    --text: #ffffff;
    --muted: #e0e0e0;
    --accent: #4caf50;
    --error: #ff6b6b;
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
        --card-bg: rgba(0, 0, 0, 0.35);
        --text: #ffffff;
        --muted: #cfd8dc;
    }
}

/* ===============================
   Global (Mobile-First)
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

/* ===============================
   Login Card
================================ */

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    text-align: center;
}

/* ===============================
   Branding
================================ */

.brand-logo img {
    width: clamp(70px, 25vw, 100px);
    margin-bottom: 12px;
}

/* ===============================
   Typography
================================ */

h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    margin-bottom: 6px;
}

p {
    font-size: clamp(0.9rem, 4vw, 1rem);
    color: var(--muted);
    margin-bottom: 20px;
}

/* ===============================
   Floating Label Inputs
================================ */

.input-group {
    position: relative;
    margin-bottom: 22px;
}

.input-group input {
    width: 100%;
    padding: 16px 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: var(--text);
    font-size: 16px; /* prevents mobile zoom */
    outline: none;
    min-height: 48px;
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.35);
}

/* Floating label */
.input-group label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--muted);
    pointer-events: none;
    transition: 0.25s ease;
    background: transparent;
}

/* Float when focused or has value */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-24px) scale(0.85);
    color: var(--accent);
}

/* ===============================
   Button
================================ */

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    min-height: 48px;
    transition: background 0.25s ease, transform 0.2s ease;
}

.login-btn:hover {
    background: #43a047;
    transform: scale(1.03);
}

.login-btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* ===============================
   Error Message
================================ */

.error-message {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* ===============================
   Forgot Link
================================ */

.signup-link {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}

.signup-link a {
    color: var(--accent);
    font-weight: bold;
    text-decoration: none;
}

.signup-link a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===============================
   Tablet Enhancement
================================ */

@media (min-width: 768px) {
    .login-container {
        padding: 32px;
    }
}

/* Landscape fix */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        align-items: flex-start;
    }
}
