@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    --error-bg: #fef2f2;
    --error-text: #dc2626;
    --error-border: #fecaca;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --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);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f4ff;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

input, textarea {
    user-select: auto;
}

/* ─── Background blobs ─── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    bottom: -10%;
    right: -5%;
    animation-delay: -7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #06b6d4, #10b981);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 40px) scale(0.95); }
    75% { transform: translate(30px, 20px) scale(1.02); }
}

/* ─── Login wrapper (card) ─── */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    width: 900px;
    max-width: 95vw;
    min-height: 560px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
    animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Brand panel (left) ─── */
.brand-panel {
    flex: 0 0 380px;
    background: url('https://images.unsplash.com/photo-1536895058696-a69b1c7ba34f?q=80&w=735&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') center/cover no-repeat;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.brand-icon svg {
    width: 32px;
    height: 32px;
}

.brand-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.brand-divider {
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin: 24px auto;
}

.brand-tagline {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.75;
    font-weight: 300;
}

.brand-footer {
    position: absolute;
    bottom: 24px;
    z-index: 1;
}

.brand-version {
    font-size: 12px;
    opacity: 0.5;
    letter-spacing: 1px;
}

/* ─── Form panel (right) ─── */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    background: rgba(255,255,255,0.6);
}

.form-content {
    width: 100%;
    max-width: 360px;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ─── Error message ─── */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    animation: shake 0.4s ease-in-out;
}

.error-message svg {
    width: 20px;
    height: 20px;
    color: var(--error-text);
    flex-shrink: 0;
}

.error-message span {
    font-size: 13px;
    color: var(--error-text);
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ─── Form fields ─── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

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

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

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* ─── Password toggle ─── */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    border-radius: 6px;
}

.toggle-password:hover {
    color: var(--text-secondary);
    background: rgba(0,0,0,0.04);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

/* ─── Form options row ─── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ─── Submit button ─── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15));
    opacity: 0;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-login svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.btn-login:hover svg {
    transform: translateX(4px);
}

/* ─── FAB ─── */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
    z-index: 10;
    animation: fab-enter 0.5s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fab svg {
    width: 22px;
    height: 22px;
}

.fab:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

@keyframes fab-enter {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* ─── About overlay & modal ─── */
.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: overlay-in 0.3s ease;
}

.about-overlay.active {
    display: flex;
}

@keyframes overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.about-modal {
    width: 420px;
    max-width: 90vw;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    animation: modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.about-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1e293b;
    transition: var(--transition);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.about-close svg {
    width: 18px;
    height: 18px;
}

.about-close:hover {
    background: #ffffff;
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.about-header {
    background: linear-gradient(135deg, #1e3a5f, #2563eb, #0891b2);
    padding: 36px 32px 28px;
    text-align: center;
    color: white;
}

.about-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.about-logo svg {
    width: 28px;
    height: 28px;
}

.about-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.about-version {
    font-size: 12px;
    opacity: 0.7;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.about-body {
    padding: 28px 32px;
}

.about-section h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.developer-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.developer-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.developer-avatar svg {
    width: 22px;
    height: 22px;
    color: white;
}

.developer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.developer-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.developer-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.about-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.about-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.about-links a svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.about-links a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.about-links a:hover svg {
    color: var(--primary);
}

.about-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.about-footer p {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        min-height: auto;
        max-height: 95vh;
    }

    .brand-panel {
        flex: 0 0 auto;
        padding: 32px 24px;
    }

    .brand-title {
        font-size: 32px;
    }

    .brand-tagline {
        display: none;
    }

    .brand-divider {
        margin: 16px auto;
    }

    .brand-footer {
        display: none;
    }

    .form-panel {
        padding: 32px 24px;
    }

    .form-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        padding: 24px 20px;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .brand-icon svg {
        width: 24px;
        height: 24px;
    }

    .brand-title {
        font-size: 28px;
    }

    .form-panel {
        padding: 24px 20px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
