/* ══════════════════════════════════════════════════════
   LOGIN / REGISTER PAGE
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

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

:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e2e8f0;
    --danger: #dc2626;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -2px rgba(15,23,42,0.05);
    --shadow-lg: 0 20px 40px rgba(15,23,42,0.1);
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Subtle animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(5, 150, 105, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

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

form h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
    color: var(--text);
}

form h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 12px auto 0;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.input-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    transition: all 150ms ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--card);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    border-radius: 6px;
    transition: color 150ms;
}

.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 18px; height: 18px; }
.eye-closed { display: none; }
.password-wrapper.show-password .eye-open { display: none; }
.password-wrapper.show-password .eye-closed { display: block; }

.password-reveal-text, .password-dots { display: none; }

.error-msg {
    display: none;
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 4px;
}

#loginError {
    display: none;
    text-align: center;
    color: var(--danger);
    font-size: 0.82rem;
    margin-bottom: 12px;
    padding: 10px;
    background: #fee2e2;
    border-radius: var(--radius);
    font-weight: 500;
}

.btn-container {
    margin-top: 24px;
}

.btn-container button,
form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-container button:hover,
form button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-container button:active,
form button[type="submit"]:active {
    transform: translateY(0);
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover { text-decoration: underline; }

/* Register specific */
.register-form .input-group { margin-bottom: 14px; }

@media (max-width: 480px) {
    body { padding: 16px; }
    form { padding: 28px 24px; }
    form h2 { font-size: 1.3rem; }
}
