/* ============================================================
   S.G.R.A.M. — Auth Pages
   Split Theme: Off-white showcase left | Rich-green form right
   ============================================================ */

/* DEMO: logo hidden — remove this block to restore */
img[src*="sgram-logo"] { display: none !important; }
.card-logo-center       { display: none !important; }
.form-header-logo       { display: none !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-900:    #14532d;
    --green-800:    #166534;
    --green-700:    #15803d;
    --green-600:    #16a34a;
    --green-400:    #4ade80;
    --green-300:    #86efac;
    --teal-700:     #0f766e;
    --teal-600:     #0d9488;
    --accent:       #34d399;
    --text-dark:    #1e293b;
    --text-mid:     #475569;
    --text-muted:   #94a3b8;
    --border-light: #e2e8f0;
    --off-white:    #f8fafc;
    --white:        #ffffff;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--off-white);
    overflow: hidden;
}

/* Canvas — sits behind everything, off-white base */
#bgCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.auth-page {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ============================================================
   LEFT PANEL — 3D Showcase  (white / off-white)
   ============================================================ */
.auth-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
    background: var(--white);
}

/* Subtle green grid overlay */
.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(22,163,74,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22,163,74,0.07) 1px, transparent 1px);
    background-size: 52px 52px;
    animation: gridShift 24s linear infinite;
    pointer-events: none;
}

@keyframes gridShift {
    0%   { background-position: 0 0; }
    100% { background-position: 52px 52px; }
}

/* Soft green radial centre glow */
.auth-left::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 560px; height: 560px;
    background: radial-gradient(circle, rgba(22,163,74,0.1) 0%, transparent 68%);
    pointer-events: none;
}

/* ── 3D Floating card ── */
.scene {
    perspective: 900px;
    margin-bottom: 36px;
    position: relative;
    z-index: 2;
}

.card-3d {
    width: 310px;
    height: 310px;
    position: relative;
    transform-style: preserve-3d;
    animation: float3d 8s ease-in-out infinite;
    cursor: default;
}

@keyframes float3d {
    0%,100% { transform: rotateX(8deg)  rotateY(-12deg) translateY(0);    }
    25%     { transform: rotateX(-4deg) rotateY(8deg)   translateY(-14px); }
    50%     { transform: rotateX(6deg)  rotateY(14deg)  translateY(-7px);  }
    75%     { transform: rotateX(-6deg) rotateY(-8deg)  translateY(-18px); }
}

.card-3d-face {
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: linear-gradient(140deg,
        rgba(240,253,244,0.95) 0%,
        rgba(255,255,255,0.90) 50%,
        rgba(240,253,244,0.85) 100%);
    border: 1.5px solid rgba(22,163,74,0.2);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow:
        0 24px 64px rgba(22,163,74,0.14),
        0 6px 20px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.card-3d-face::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(22,163,74,0.12), transparent 55%);
    pointer-events: none;
}

/* ── Orbiting rings ── */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
}

.orbit-1 {
    width: 370px; height: 370px;
    top: 50%; left: 50%;
    margin: -185px 0 0 -185px;
    animation: spin 14s linear infinite;
    border: 1px solid rgba(22,163,74,0.25);
}
.orbit-2 {
    width: 450px; height: 450px;
    top: 50%; left: 50%;
    margin: -225px 0 0 -225px;
    animation: spin 22s linear infinite reverse;
    border: 1px solid rgba(13,148,136,0.18);
}
.orbit-3 {
    width: 530px; height: 530px;
    top: 50%; left: 50%;
    margin: -265px 0 0 -265px;
    animation: spin 32s linear infinite;
    border: 1px solid rgba(22,163,74,0.1);
}

@keyframes spin { to { transform: rotate(360deg); } }

.orbit-dot {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green-600);
    top: -4px; left: 50%;
    margin-left: -4px;
    box-shadow: 0 0 8px var(--green-600), 0 0 18px rgba(22,163,74,0.4);
}
.orbit-2 .orbit-dot {
    background: var(--teal-600);
    box-shadow: 0 0 8px var(--teal-600);
}
.orbit-3 .orbit-dot {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    width: 6px; height: 6px;
    top: -3px; margin-left: -3px;
}

/* ── Icons inside 3D card ── */
.card-icons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
}

.card-icon-item {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(240,253,244,0.8);
    border: 1px solid rgba(22,163,74,0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: var(--green-700);
    animation: iconPulse 3s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(22,163,74,0.08);
}
.card-icon-item:nth-child(2) { animation-delay: 0.4s; }
.card-icon-item:nth-child(3) { animation-delay: 0.8s; }
.card-icon-item:nth-child(4) { animation-delay: 1.2s; }
.card-icon-item:nth-child(5) { animation-delay: 0.2s; }
.card-icon-item:nth-child(6) { animation-delay: 1.6s; }
.card-icon-item:nth-child(7) { animation-delay: 0.6s; }
.card-icon-item:nth-child(8) { animation-delay: 1.0s; }
.card-icon-item:nth-child(9) { animation-delay: 1.8s; }

@keyframes iconPulse {
    0%,100% { transform: translateY(0);   opacity: 0.8; }
    50%     { transform: translateY(-4px); opacity: 1;   }
}

.card-logo-center {
    position: absolute;
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.2), 0 4px 20px rgba(22,163,74,0.2);
    border: 2px solid rgba(22,163,74,0.3);
    z-index: 2;
}
.card-logo-center img {
    width: 52px; height: 52px;
    object-fit: contain;
}

/* ── Left panel branding ── */
.auth-brand { text-align: center; position: relative; z-index: 2; }

.auth-brand-name {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--green-700);
    line-height: 1;
    margin-bottom: 6px;
}
.auth-tagline {
    font-size: 0.95rem;
    color: var(--text-mid);
    font-style: italic;
}

/* ── Stat chips ── */
.auth-stats {
    display: flex;
    gap: 10px;
    margin-top: 26px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    justify-content: center;
}
.stat-chip {
    background: rgba(22,163,74,0.07);
    border: 1px solid rgba(22,163,74,0.2);
    border-radius: 100px;
    padding: 6px 15px;
    font-size: 0.76rem;
    color: var(--green-800);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat-chip i { color: var(--green-600); }

/* ============================================================
   RIGHT PANEL — Form  (rich green)
   ============================================================ */
.auth-right {
    width: 500px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    background: linear-gradient(160deg, var(--green-800) 0%, #0d4f42 55%, var(--teal-700) 100%);
    border-left: none;
    position: relative;
    box-shadow: -6px 0 32px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* Subtle pattern overlay on green right panel */
.auth-right::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Top accent line */
.auth-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, #86efac, #34d399, #5eead4);
    z-index: 1;
}

.auth-form-wrap {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

/* Form header */
.form-header { margin-bottom: 24px; text-align: center; }

.form-header-logo {
    width: 180px; height: 180px;
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
}
.form-header-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.25));
}
.form-header-logo-fallback {
    width: 180px; height: 180px;
    border-radius: 38px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 4.8rem;
    color: #86efac;
}
.form-header p {
    font-size: 0.87rem;
    color: rgba(255,255,255,0.65);
}

/* Fields */
.field-group { margin-bottom: 16px; }

.field-label {
    display: block;
    font-size: 0.73rem;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}

.field-wrap { position: relative; }

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.88rem;
    pointer-events: none;
    transition: color 0.25s;
}
.field-group:focus-within .field-icon { color: #86efac; }

.auth-input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 13px 14px 13px 42px;
    font-size: 0.94rem;
    color: #ffffff;
    outline: none;
    transition: all 0.25s;
    appearance: none;
}
.auth-input::placeholder { color: rgba(255,255,255,0.35); }
.auth-input:focus {
    border-color: #86efac;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 3px rgba(134,239,172,0.2);
}

.field-border {
    position: absolute;
    bottom: 0; left: 10px; right: 10px;
    height: 2px;
    background: linear-gradient(90deg, #86efac, #34d399);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.25s;
}
.auth-input:focus ~ .field-border { opacity: 1; }

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 4px;
    font-size: 0.88rem;
    transition: color 0.25s;
}
.eye-btn:hover { color: rgba(255,255,255,0.9); }

/* Remember / Forgot row */
.form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.6);
}
.remember-check {
    width: 16px; height: 16px;
    border-radius: 4px;
    accent-color: #86efac;
    cursor: pointer;
}
.forgot-link {
    font-size: 0.82rem;
    color: #86efac;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.forgot-link:hover { color: #bbf7d0; }

/* Submit button — white on green for contrast */
.btn-signin {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #ffffff;
    color: var(--green-800);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.btn-signin:hover {
    transform: translateY(-2px);
    background: #f0fdf4;
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
.btn-signin:active { transform: translateY(0); }
.btn-signin::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(22,163,74,0.12), transparent);
    transition: left 0.45s;
}
.btn-signin:hover::before { left: 100%; }
.btn-signin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.15);
}
.auth-divider span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}

/* Register link */
.auth-register {
    text-align: center;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.55);
}
.auth-register a {
    color: #86efac;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}
.auth-register a:hover { color: #bbf7d0; }

/* Alert */
.auth-alert {
    background: rgba(254,226,226,0.15);
    border: 1px solid rgba(252,165,165,0.4);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.auth-alert i { margin-top: 2px; flex-shrink: 0; }
.auth-alert ul { margin: 0; padding-left: 16px; }

/* Security badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 0.71rem;
    color: rgba(255,255,255,0.35);
}
.security-badge i { color: #86efac; }

/* Mobile */
@media (max-width: 900px) {
    .auth-left { display: none; }
    .auth-right {
        width: 100%;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .auth-right { padding: 28px 20px; }
}
