/* ==========================================================================
   ZSM Digital — Portal Login
   Simplified, intuitive design inspired by homepage
   HCI Principles: Visibility, Feedback, Consistency, Affordance, Simplicity
   ========================================================================== */

:root {
    --bg-color: #050505;
    --surface: #0a0a0b;
    --surface-raised: #111113;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: #999999;
    --text-muted: #666666;
    --accent: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow: hidden;
}

/* Subtle ambient background glow — matches homepage hero */
body::before {
    content: '';
    position: fixed;
    top: 30%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Login Container ──────────────────────────────────────────────── */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    margin: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.1s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Logo Section ─────────────────────────────────────────────────── */
.logo-section {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: url('https://zsm.digital/static/cleaned_transparent_image.png') center/contain no-repeat;
    filter: brightness(1.2);
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.05);
}

.subtitle {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Title ────────────────────────────────────────────────────────── */
h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 36px;
    text-align: center;
    letter-spacing: -0.03em;
    color: var(--text-main);
    line-height: 1.2;
}

/* ── Form Card ────────────────────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    margin-bottom: 24px;
}

/* ── Form Elements ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 28px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 0.01em;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 400;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

input[type="email"]:hover,
input[type="password"]:hover {
    border-color: var(--border-hover);
}

input[type="email"]:focus,
input[type="password"]:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Login Button — matches homepage CTA ──────────────────────────── */
.login-btn {
    width: 100%;
    padding: 14px 28px;
    background: white;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.login-btn:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    background: #d4d4d4;
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Focus ring for keyboard accessibility (HCI: Accessibility) */
.login-btn:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* ── Error Message — clear visual feedback (HCI: Feedback) ────────── */
.error-message {
    background: rgba(239, 68, 68, 0.06);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.12);
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message::before {
    content: '!';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

/* ── Help & Links ─────────────────────────────────────────────────── */
.help-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.help-text a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1px;
}

.help-text a:hover {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.back-link {
    display: block;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    padding: 8px 0;
}

.back-link:hover {
    color: white;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-container {
        margin: 16px;
    }

    .form-card {
        padding: 28px 24px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
    }
}