/* ===== LOGIN PAGE — AgroClima ===== */

/* ===== RESET ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { width:100%; height:100%; overflow:hidden; background:#000; font-family:'Inter',system-ui,sans-serif; color:#fff; }
/* Hide scrollbar everywhere */
::-webkit-scrollbar { display:none; }
html, body, .login-page { scrollbar-width:none; -ms-overflow-style:none; }

/* ===== CANVAS BG ===== */
#login-bg-canvas {
    position:fixed; inset:0; width:100%; height:100%;
    z-index:0;
}

/* ===== PAGE CONTAINER ===== */
.login-page {
    position:relative; z-index:10;
    width:100%; height:100%;
    display:flex; align-items:center; justify-content:center;
    padding:20px;
    overflow-y:auto;
    perspective: 1200px;
}

/* ===== GLASS CARD ===== */
.glass-card {
    margin:auto; /* Safe flex centering */
    position:relative;
    width:100%; max-width:460px;
    background: rgba(10, 18, 14, 0.55);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 30px 32px 24px;
    box-shadow:
        0 0 80px rgba(30,180,90,0.08),
        0 40px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.06);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.6s ease, box-shadow 0.6s ease;
    transform-style: preserve-3d;
}

.glass-card.view-switching {
    transform: scale(0.92) rotateY(-8deg) rotateX(4deg);
    opacity: 0.7;
    box-shadow:
        0 0 40px rgba(30,180,90,0.04),
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.06);
}

@keyframes cardAppear {
    from { opacity:0; transform:translateY(40px) scale(0.96); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

/* ===== BRAND ===== */
.brand {
    display:flex; align-items:center; gap:10px;
    margin-bottom:20px; text-decoration:none; color:#fff;
}
.brand img { width:38px; height:auto; filter:drop-shadow(0 0 8px rgba(46,204,113,0.4)); }
.brand span { font-size:16px; font-weight:700; letter-spacing:2px; }

/* ===== VIEW SYSTEM ===== */
.auth-view { display:none; }
.auth-view.is-active { display:block; }
.auth-view.is-leaving { display:block; position:absolute; inset: 30px 32px 24px; pointer-events: none; }

/* Staggered entrance for form elements (Framer Motion feel) */
.auth-view.is-active > *,
.auth-view.is-active .auth-form > * {
    animation: itemAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.auth-view.is-leaving > *,
.auth-view.is-leaving .auth-form > * {
    animation: itemDisappear 0.25s ease-in forwards;
}

/* Stagger delays */
.auth-view.is-active .eyebrow { animation-delay: 0.05s; }
.auth-view.is-active h2 { animation-delay: 0.1s; }
.auth-view.is-active .description { animation-delay: 0.15s; }

.auth-view.is-active .auth-form > :nth-child(1) { animation-delay: 0.2s; }
.auth-view.is-active .auth-form > :nth-child(2) { animation-delay: 0.25s; }
.auth-view.is-active .auth-form > :nth-child(3) { animation-delay: 0.3s; }
.auth-view.is-active .auth-form > :nth-child(4) { animation-delay: 0.35s; }
.auth-view.is-active .auth-form > :nth-child(5) { animation-delay: 0.4s; }
.auth-view.is-active .auth-form > :nth-child(6) { animation-delay: 0.45s; }
.auth-view.is-active .auth-form > :nth-child(7) { animation-delay: 0.5s; }

.auth-view.is-active .social-divider { animation-delay: 0.5s; }
.auth-view.is-active .social-buttons { animation-delay: 0.55s; }
.auth-view.is-active .auth-switch { animation-delay: 0.6s; }

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

@keyframes itemDisappear {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

/* ===== TYPOGRAPHY ===== */
.eyebrow { font-size:11px; font-weight:500; color:rgba(46,204,113,0.8); text-transform:uppercase; letter-spacing:1.5px; margin-bottom:2px; }
.glass-card h2 { font-size:22px; font-weight:700; margin-bottom:4px; line-height:1.2; }
.description { font-size:13px; color:rgba(255,255,255,0.5); margin-bottom:16px; line-height:1.4; }

/* ===== FORM ===== */
.auth-form { display:flex; flex-direction:column; gap:10px; }
.form-row { display:flex; gap:10px; width:100%; }
.form-row > div { flex:1; display:flex; flex-direction:column; gap:10px; }

.auth-form label { font-size:12px; font-weight:500; color:rgba(255,255,255,0.7); margin-bottom:-6px; }
.auth-form input[type="email"],
.auth-form input[type="text"],
.auth-form input[type="password"] {
    width:100%; padding:10px 14px;
    background:rgba(255,255,255,0.06);
    border:1px solid rgba(255,255,255,0.1);
    border-radius:10px; color:#fff;
    font-size:13px; font-family:inherit;
    outline:none; transition:all 0.2s;
}
.auth-form input:focus {
    border-color:rgba(46,204,113,0.8);
    background:rgba(255,255,255,0.12);
    box-shadow:0 0 0 4px rgba(46,204,113,0.2);
}
.auth-form input::placeholder { color:rgba(255,255,255,0.25); }

/* Password field */
.password-field { position:relative; }
.password-field input { padding-right:60px; }
.password-toggle {
    position:absolute; right:10px; top:50%; transform:translateY(-50%);
    background:none; border:none; color:rgba(0, 0, 0, 0.4);
    font-size:11px; font-weight:500; cursor:pointer;
    padding:4px 6px; border-radius:4px;
    transition:all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.password-toggle:hover { color:#000000; background:rgba(255,255,255,0.08); transform:translateY(-50%) scale(1.05); }
.password-toggle:active { transform:translateY(-50%) scale(0.95); }

/* Options row */
.auth-options {
    display:flex; align-items:center; justify-content:space-between;
    font-size:13px; margin:-4px 0;
}
.check-label { display:flex; align-items:center; gap:6px; color:rgba(255,255,255,0.6); cursor:pointer; font-size:13px; }
.check-label input[type="checkbox"] { accent-color:#2ecc71; width:15px; height:15px; }
.auth-link {
    background:none; border:none; color:rgba(46,204,113,0.8);
    font-size:13px; cursor:pointer; font-family:inherit;
}
.auth-link:hover { color:#2ecc71; text-decoration:underline; }

/* Submit button */
.auth-submit {
    width:100%; padding:14px;
    background: linear-gradient(135deg, #1a9c55 0%, #2ecc71 50%, #27ae60 100%);
    border:none; border-radius:12px;
    color:#fff; font-size:15px; font-weight:600;
    cursor:pointer; font-family:inherit;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(46,204,113,0.3);
    margin-top:4px;
}
.auth-submit:hover { transform:translateY(-2px) scale(1.02); box-shadow:0 8px 25px rgba(46,204,113,0.45); }
.auth-submit:active { transform:translateY(1px) scale(0.97); box-shadow:0 2px 10px rgba(46,204,113,0.3); }
.auth-submit:disabled { opacity:0.6; cursor:not-allowed; transform:none; }

/* Status message */
.auth-status { font-size:13px; min-height:18px; text-align:center; color:#e74c3c; margin-top:2px; }
.auth-status.success { color:#2ecc71; }

/* ===== DIVIDER ===== */
.social-divider {
    display:flex; align-items:center; gap:12px;
    margin:20px 0 16px; color:rgba(255,255,255,0.3); font-size:12px;
}
.social-divider::before, .social-divider::after {
    content:''; flex:1; height:1px;
    background:linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ===== SOCIAL BUTTONS ===== */
.social-buttons { display:flex; gap:10px; }
.social-btn {
    flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
    padding:11px 8px;
    background:rgba(255,255,255,0.04);
    border:1px solid rgba(255,255,255,0.1);
    border-radius:12px; color:#fff;
    font-size:13px; font-weight:500;
    cursor:pointer; font-family:inherit;
    transition:all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-btn:hover { background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.25); transform:translateY(-2px) scale(1.02); }
.social-btn:active { transform:translateY(1px) scale(0.97); }
.social-btn svg { width:18px; height:18px; flex-shrink:0; }

/* ===== ROLE SELECTOR ===== */
.role-selector { display:flex; gap:6px; margin-bottom:2px; }
.role-option { flex:1; position:relative; }
.role-option input[type="radio"] { position:absolute; opacity:0; pointer-events:none; }
.role-card {
    display:flex; flex-direction:column; align-items:center;
    padding:10px 4px; gap:4px;
    background:rgba(255,255,255,0.04);
    border:1.5px solid rgba(255,255,255,0.08);
    border-radius:12px; cursor:pointer;
    transition:all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.role-card:hover { background:rgba(255,255,255,0.07); transform:translateY(-2px); }
.role-card:active { transform:scale(0.97); }
.role-card svg { width:18px; height:18px; fill:rgba(255,255,255,0.5); transition:fill 0.2s; }
.role-card span { font-size:11px; font-weight:500; color:rgba(255,255,255,0.6); transition:color 0.2s; }
.role-option input:checked + .role-card {
    background:rgba(46,204,113,0.12);
    border-color:rgba(46,204,113,0.5);
    box-shadow: 0 4px 20px rgba(46,204,113,0.15);
}
.role-option input:checked + .role-card svg { fill:#2ecc71; }
.role-option input:checked + .role-card span { color:#2ecc71; font-weight:600; }

/* ===== SWITCH LINK ===== */
.auth-switch {
    text-align:center; font-size:12px;
    color:rgba(255,255,255,0.4); margin-top:16px;
}
.auth-switch button {
    background:none; border:none;
    color:#2ecc71; font-size:12px; font-weight:600;
    cursor:pointer; font-family:inherit;
}
.auth-switch button:hover { text-decoration:underline; }

/* ===== TERMS ===== */
.terms { margin-top:-2px; font-size: 11px !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    .glass-card { padding:24px 20px 20px; border-radius:20px; max-width:100%; }
    .glass-card h2 { font-size:20px; }
    .social-btn { font-size:0; gap:0; } /* Hide text, show only icon */
    .social-btn svg { width:20px; height:20px; }
    .form-row { flex-direction:column; gap:10px; }
}

/* ====== SPOTLIGHT GLOW ANIMATION ====== */
.glass-card {
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.08), transparent 40%);
    z-index: 0;
    pointer-events: none;
}
.auth-form input {
    position: relative;
}
.input-wrapper {
    position: relative;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    transition: background 0.3s;
}
.input-wrapper::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.8), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.input-wrapper:hover::before, .input-wrapper:focus-within::before {
    opacity: 1;
}


/* ====== SPOTLIGHT GLOW ANIMATION ====== */
.glass-card {
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.05), transparent 40%);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.auth-form input, .auth-form .auth-submit, .auth-form .social-btn {
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(255,255,255,0.03);
}
.auth-form input:hover, .auth-form .auth-submit:hover, .auth-form .social-btn:hover {
    border-color: rgba(255,255,255,0.2);
}
.auth-form input::after, .auth-form .auth-submit::after, .auth-form .social-btn::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(300px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.6), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}
.auth-form input:hover::after, .auth-form input:focus::after, 
.auth-form .auth-submit:hover::after, .auth-form .social-btn:hover::after {
    opacity: 1;
}

.auth-form input {
    background-image: radial-gradient(300px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.15), transparent 40%);
}
.auth-form input:focus {
    background-image: radial-gradient(300px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(46,204,113, 0.25), transparent 40%);
}
.auth-submit {
    background: #2ecc71 !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 15px rgba(46,204,113,0.4) !important;
    transition: all 0.3s ease !important;
}
.auth-submit:hover {
    box-shadow: 0 0 25px rgba(46,204,113,0.7) !important;
    transform: translateY(-2px);
}
