:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Auth layout ─────────────────────────────────────── */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%,  100% { transform: translate(0, 0) rotate(0deg); }
    33%        { transform: translate(30px, -30px) rotate(120deg); }
    66%        { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 460px;
    animation: slideUp 0.4s ease-out;
    position: relative;
    z-index: 1;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* ── Forms ───────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group-custom:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    pointer-events: none;
    line-height: 1;
}

.input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* ── Buttons ─────────────────────────────────────────── */

.btn-primary,
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    color: #fff;
    padding: 0.8125rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary:hover,
.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.btn-primary:active,
.btn-primary-custom:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8125rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.btn-social {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
}

.btn-social:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--text-primary);
    transform: translateY(-1px);
    text-decoration: none;
}

/* ── Checkbox ────────────────────────────────────────── */

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── Links ───────────────────────────────────────────── */

.text-primary {
    color: var(--primary-color) !important;
}

a.text-primary:hover {
    color: var(--primary-hover) !important;
}

/* ── Divider ─────────────────────────────────────────── */

.divider-custom {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
}

.divider-custom::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.divider-custom span {
    position: relative;
    background: var(--surface);
    padding: 0 1rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Alerts / validation ─────────────────────────────── */

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--success-color);
    color: #166534;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.text-danger {
    color: var(--danger-color) !important;
}

.fontsizeSmall {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}

/* ── Home / generic pages ────────────────────────────── */

.home-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--background);
}

.home-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 520px;
    text-align: center;
}

.home-card h1,
.home-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.home-card p,
.home-card .lead {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.auth-footnote {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .home-card {
        padding: 2rem 1.5rem;
    }
}
