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

:root {
    --primary: #28732C;
    --primary-light: #33943a;
    --primary-dark: #1b4d1d;
    --primary-glow: rgba(40, 115, 44, 0.25);
    --white: #ffffff;
    --bg: #f7faf7;
    --surface: #ffffff;
    --text: #1a261a;
    --text-muted: #6b7f6b;
    --border: #e2ede2;
    --input-bg: #f4f9f4;
    --error: #d93025;
    --error-bg: #fef0ef;
    --transition: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    height: 100%;
    font-family: 'Lexend Deca', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ───────────────────────────────────────────────── */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ─── Left Panel ────────────────────────────────────────────── */
.auth-panel {
    position: relative;
    background: var(--primary-dark);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 3rem;
    text-align: center;
}

/* Multi-layer gradient background */
.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, #3a9b40 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 80%, #1b4d1d 0%, transparent 60%),
        linear-gradient(145deg, #28732C 0%, #143d17 100%);
}

/* Decorative blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: float 8s ease-in-out infinite;
}
.blob-1 {
    width: 400px;
    height: 400px;
    background: #52c45a;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}
.blob-2 {
    width: 300px;
    height: 300px;
    background: #28732C;
    bottom: -80px;
    right: -80px;
    animation-delay: -4s;
}
.blob-3 {
    width: 200px;
    height: 200px;
    background: #a8f5ad;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    animation-delay: -2s;
}

.panel-content {
    position: relative;
    z-index: 2;
}

/* Logo icon */
.panel-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    backdrop-filter: blur(12px);
    margin-bottom: 2rem;
    box-shadow: 0 0 60px rgba(80, 200, 90, 0.3), 0 20px 40px rgba(0,0,0,0.2);
    animation: logoPulse 3s ease-in-out infinite;
}

.panel-logo i {
    font-size: 2.4rem;
    color: white;
}

.panel-brand {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 1rem;
}

.panel-brand span {
    color: rgba(255,255,255,0.6);
}

.panel-tagline {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    max-width: 260px;
    line-height: 1.7;
    margin-bottom: 3rem;
}

/* Floating chat bubbles decoration */
.bubbles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 260px;
}

.bubble {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 0.7rem 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 400;
    animation: bubbleFloat 6s ease-in-out infinite;
    align-self: flex-start;
}

.bubble:nth-child(2) {
    align-self: flex-end;
    animation-delay: -2s;
}
.bubble:nth-child(3) {
    animation-delay: -4s;
}

/* Bottom dots */
.panel-dots {
    display: flex;
    gap: 8px;
    margin-top: 3rem;
    justify-content: center;
}
.panel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}
.panel-dots span.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ─── Right Panel (Form) ─────────────────────────────────────── */
.auth-form-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 3rem;
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

/* Subtle corner decoration */
.auth-form-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(40,115,44,0.06) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.auth-form-section::before {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(40,115,44,0.05) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    border-radius: 50%;
}

.form-box {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: slideUpFade 0.7s var(--transition) both;
}

/* Top branding in form */
.form-top-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
}

.form-top-brand i {
    color: var(--primary);
    font-size: 1.4rem;
}

.form-top-brand span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.form-heading h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.form-heading p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* ─── Inputs ─────────────────────────────────────────────────── */
.field {
    margin-bottom: 1.25rem;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.field-input {
    width: 100%;
    height: 56px;
    padding: 0 3.5rem 0 3.2rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: var(--input-bg);
    font-family: 'Lexend Deca', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    transition: all 0.3s var(--transition);
    outline: none;
    appearance: none;
}

.field-input::placeholder {
    color: #b0c4b0;
    font-weight: 300;
}

.field-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

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

/* Password toggle */
.field-toggle {
    position: absolute;
    right: 1.1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem;
    border-radius: 6px;
    transition: color 0.2s ease;
    z-index: 2;
}

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

/* Error state */
.field.has-error .field-input {
    border-color: var(--error);
    background: var(--error-bg);
}
.field-error {
    display: none;
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.45rem;
    margin-left: 0.3rem;
    font-weight: 400;
}
.field.has-error .field-error {
    display: block;
}

/* ─── Button ─────────────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    height: 56px;
    margin-top: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 20px rgba(40, 115, 44, 0.35);
    transition: all 0.3s var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-submit:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(40, 115, 44, 0.4);
}

.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }

/* ─── Footer ─────────────────────────────────────────────────── */
.form-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.form-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-20px); }
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); opacity: 0.85; }
    50%       { transform: translateY(-8px); opacity: 1; }
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 60px rgba(80, 200, 90, 0.3), 0 20px 40px rgba(0,0,0,0.2); }
    50%       { box-shadow: 0 0 80px rgba(80, 200, 90, 0.5), 0 20px 40px rgba(0,0,0,0.2); }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }
    .auth-panel {
        display: none;
    }
    .auth-form-section {
        padding: 2.5rem 1.5rem;
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@media (max-width: 480px) {
    .auth-form-section { padding: 1.5rem 1rem; justify-content: flex-start; }
    .form-box { max-width: none; margin: auto 0; }
    .form-top-brand { margin-bottom: 1.75rem; }
    .form-heading h2 { font-size: clamp(1.55rem, 8vw, 1.85rem); }
    .form-heading p { margin-bottom: 1.75rem; line-height: 1.55; }
    .field-input { height: 52px; border-radius: 13px; font-size: 16px; }
    .btn-submit { height: 52px; border-radius: 13px; }
    .form-footer { margin-top: 1.5rem; line-height: 1.6; }
}

@media (max-height: 650px) and (orientation: landscape) {
    .auth-form-section { justify-content: flex-start; padding-block: 1.25rem; overflow-y: auto; }
    .form-top-brand, .form-heading p { margin-bottom: 1rem; }
    .field { margin-bottom: 0.85rem; }
    .field-input, .btn-submit { height: 48px; }
    .form-footer { margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
