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

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    background: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────────── */
.auth-container {
    display: flex;
    min-height: 100vh;
}

/* Left: Branding hero panel */
.auth-hero {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    text-align: center;
}

.auth-hero-logo {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-hero-logo svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.auth-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.auth-hero h1 span {
    display: block;
    font-weight: 300;
    font-size: 1.25rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    letter-spacing: 0;
}

.auth-hero-desc {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Feature highlights */
.auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(4px);
}

.auth-feature-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-feature-icon svg {
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,0.9);
}

.auth-feature-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
}

.auth-feature-text small {
    display: block;
    font-weight: 400;
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

/* Right: Form panel */
.auth-form-panel {
    width: 520px;
    min-width: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: #fff;
    position: relative;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.auth-form-header p {
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* Form elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.01em;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    font-size: 0.8125rem;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input::placeholder {
    color: #cbd5e1;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Password input with toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: #64748b;
}

/* Submit button */
.auth-submit {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-submit .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}

.auth-submit.loading .spinner {
    display: inline-block;
}

.auth-submit.loading .btn-text {
    opacity: 0.8;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    font-size: 0.6875rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Footer links */
.auth-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-footer a {
    font-size: 0.75rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.auth-footer a:hover {
    color: #1d4ed8;
}

.auth-footer .secondary {
    color: #94a3b8;
}

.auth-footer .secondary:hover {
    color: #64748b;
}

/* Toast notification */
.auth-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.auth-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-toast.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-toast.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.auth-toast.info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Back to app link */
.back-to-app {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: #f1f5f9;
}

.back-to-app:hover {
    color: #475569;
    background: #e2e8f0;
}

/* Checkbox */
.auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.auth-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    accent-color: #2563eb;
    margin-top: 1px;
    cursor: pointer;
}

.auth-checkbox-row label {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    cursor: pointer;
}

.auth-checkbox-row label a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.auth-checkbox-row label a:hover {
    text-decoration: underline;
}

/* Error message */
.field-error {
    font-size: 0.6875rem;
    color: #ef4444;
    margin-top: 0.25rem;
    display: none;
}

.field-error.show {
    display: block;
}

/* Company badge (bottom of hero) */
.auth-company-badge {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.auth-company-badge span {
    font-size: 0.625rem;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Floating shapes (background decoration) */
.auth-hero .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #fff;
}

.auth-hero .shape-1 {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -80px;
    animation: float 20s ease-in-out infinite;
}

.auth-hero .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -40px;
    animation: float 15s ease-in-out infinite reverse;
}

.auth-hero .shape-3 {
    width: 120px;
    height: 120px;
    top: 40%;
    right: 15%;
    animation: float 12s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(10px, -15px) scale(1.02); }
    50% { transform: translate(-5px, 10px) scale(0.98); }
    75% { transform: translate(8px, 5px) scale(1.01); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-hero {
        display: none;
    }

    .auth-form-panel {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .auth-form-panel::before {
        content: '';
        display: block;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-footer {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
