/**
 * Silva Auth Forms - Split-Screen Premium Edition v2
 * Brand Blue: #014385  |  Gold: #FFC107
 */

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

:root {
    --silva-blue:      #014385;
    --silva-blue-dark: #001f4d;
    --silva-blue-mid:  #0A5CAA;
    --silva-gold:      #FFC107;
    --silva-gold-dark: #e6a800;
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Page reset ─────────────────────────────────────────── */
.silva-auth-container *,
.silva-auth-container *::before,
.silva-auth-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Outer wrapper ──────────────────────────────────────── */
.silva-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    font-family: var(--font-main);
    background: #f0f4f8;
}

/* ═══════════════════════════════════════════════════════════
   LEFT BRAND PANEL
═══════════════════════════════════════════════════════════ */
.silva-auth-panel {
    position: relative;
    width: 45%;
    background: var(--silva-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

/* Subtle dot-grid texture */
.silva-auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Gold accent bar on right edge */
.silva-auth-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--silva-gold) 0%, transparent 100%);
    opacity: .6;
}

.silva-panel-inner {
    position: relative;
    z-index: 1;
    padding: 3rem 2.5rem;
    max-width: 360px;
    animation: silva-fade-up .7s ease both;
}

.silva-panel-logo {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-bottom: 2.5rem;
}

.silva-panel-logo span {
    color: var(--silva-gold);
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.silva-panel-headline {
    font-size: 2.625rem;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 1rem;
}

.silva-panel-headline em {
    font-style: normal;
    color: var(--silva-gold);
}

.silva-panel-sub {
    font-size: .9375rem;
    color: rgba(255,255,255,.65);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.silva-panel-stats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 2rem;
}

.silva-panel-stats li {
    display: flex;
    align-items: baseline;
    gap: .625rem;
}

.silva-panel-stats strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--silva-gold);
    min-width: 3rem;
}

.silva-panel-stats span {
    font-size: .875rem;
    color: rgba(255,255,255,.6);
}

/* Decorative dots (bottom-right of panel) */
.silva-panel-dots {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 80px;
    height: 80px;
    background-image: radial-gradient(circle, rgba(255,193,7,.35) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: .7;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   RIGHT FORM PANEL
═══════════════════════════════════════════════════════════ */
.silva-auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    background: #ffffff;
    animation: silva-fade-up .7s .15s ease both;
}

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

.silva-auth-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--silva-blue-dark);
    margin-bottom: .375rem;
    line-height: 1.2;
}

.silva-auth-header p {
    font-size: .9rem;
    color: #6b7280;
}

/* ── Form ───────────────────────────────────────────────── */
.silva-auth-form {
    width: 100%;
    max-width: 400px;
}

.silva-form-group {
    margin-bottom: 1.25rem;
}

/* Floating label group */
.silva-float-group {
    position: relative;
}

.silva-float-input {
    width: 100%;
    padding: 1.125rem 1rem .5rem;
    font-size: .9375rem;
    color: #111827;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
    font-family: var(--font-main);
    display: block;
}

.silva-float-input:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

.silva-float-input:focus {
    border-color: var(--silva-blue);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(1, 67, 133, .09);
}

/* Floating label */
.silva-float-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .9375rem;
    color: #9ca3af;
    pointer-events: none;
    transition: top .18s, font-size .18s, color .18s, transform .18s;
    font-family: var(--font-main);
    background: transparent;
}

/* Label rises when input is focused OR has a value (placeholder=' ' trick) */
.silva-float-input:focus + .silva-float-label,
.silva-float-input:not(:placeholder-shown) + .silva-float-label {
    top: .5rem;
    transform: translateY(0);
    font-size: .75rem;
    color: var(--silva-blue);
    font-weight: 600;
}

/* ── Password wrapper ───────────────────────────────────── */
.silva-password-wrapper {
    position: relative;
}

.silva-password-wrapper .silva-float-input {
    padding-right: 3rem;
}

/* Float label inside password wrapper */
.silva-password-wrapper .silva-float-label {
    top: 50%;
    transform: translateY(-50%);
}

.silva-password-wrapper .silva-float-input:focus + .silva-float-label,
.silva-password-wrapper .silva-float-input:not(:placeholder-shown) + .silva-float-label {
    top: .5rem;
    transform: translateY(0);
    font-size: .75rem;
    color: var(--silva-blue);
    font-weight: 600;
}

.silva-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 2.75rem;
    background: transparent;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s;
    padding: 0;
}

.silva-password-toggle:hover { color: var(--silva-blue); }
.silva-password-toggle:focus { outline: none; }

.silva-eye-icon { display: flex; }

/* ── Inline row (remember + forgot) ────────────────────── */
.silva-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.375rem;
}

.silva-form-checkbox {
    margin-bottom: 0;
}

.silva-form-checkbox label {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    font-size: .875rem;
    color: #374151;
    font-weight: 400;
}

.silva-form-checkbox input[type=checkbox] {
    accent-color: var(--silva-blue);
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.silva-forgot-inline {
    font-size: .8125rem;
    color: var(--silva-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
}

.silva-forgot-inline:hover { color: var(--silva-blue-mid); text-decoration: underline; }

/* ── Button ─────────────────────────────────────────────── */
.silva-btn {
    width: 100%;
    padding: .9375rem 1.5rem;
    font-size: .9375rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    position: relative;
    overflow: hidden;
    transition: background .2s, transform .15s, box-shadow .2s;
}

.silva-btn-primary {
    background: var(--silva-blue);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(1, 67, 133, .25);
}

/* Shimmer sweep on hover */
.silva-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
    transform: skewX(-20deg);
    transition: left .5s ease;
    pointer-events: none;
}

.silva-btn-primary:hover::after { left: 130%; }

.silva-btn-primary:hover {
    background: var(--silva-blue-mid);
    box-shadow: 0 6px 20px rgba(1, 67, 133, .32);
    transform: translateY(-1px);
}

.silva-btn-primary:active { transform: translateY(0); }

/* Loading state */
.silva-btn.loading .silva-btn-text { opacity: 0; }
.silva-btn.loading .silva-btn-spinner { opacity: 1; }
.silva-btn.loading { pointer-events: none; }

.silva-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: silva-spin .7s linear infinite;
    position: absolute;
}

.silva-btn.loading .silva-btn-spinner { display: block; }

/* ── Messages ───────────────────────────────────────────── */
.silva-auth-message {
    padding: .875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: .875rem;
    line-height: 1.5;
    border-left: 3px solid;
    font-family: var(--font-main);
}

.silva-auth-error  { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.silva-auth-success{ background: #f0fdf4; border-color: #22c55e; color: #166534; }

/* ── Footer ─────────────────────────────────────────────── */
.silva-auth-footer {
    margin-top: 1.5rem;
    font-size: .8125rem;
    color: #9ca3af;
}

.silva-auth-footer span { margin-right: .3rem; }

.silva-signup-link {
    color: var(--silva-blue);
    text-decoration: none;
    font-weight: 600;
}

.silva-signup-link:hover { color: var(--silva-blue-mid); text-decoration: underline; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes silva-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes silva-shake {
    0%,100% { transform: translateX(0); }
    15%     { transform: translateX(-7px); }
    30%     { transform: translateX(7px); }
    45%     { transform: translateX(-5px); }
    60%     { transform: translateX(5px); }
    75%     { transform: translateX(-3px); }
    90%     { transform: translateX(3px); }
}

.silva-shake {
    animation: silva-shake .45s ease both;
}

/* ── Toast notifications ────────────────────────────────── */
.silva-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .625rem;
    pointer-events: none;
}

.silva-toast {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .875rem 1rem;
    border-radius: 10px;
    background: #1e293b;
    color: #f8fafc;
    font-size: .875rem;
    font-family: var(--font-main);
    max-width: 340px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    pointer-events: auto;
    animation: silva-fade-up .3s ease;
}

.silva-toast.error   { background: #7f1d1d; border-left: 3px solid #ef4444; }
.silva-toast.success { background: #14532d; border-left: 3px solid #22c55e; }
.silva-toast-icon    { font-weight: 700; flex-shrink: 0; }
.silva-toast-message { flex: 1; line-height: 1.45; }
.silva-toast-close   { background: none; border: none; color: rgba(255,255,255,.55); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0 0 .25rem; flex-shrink: 0; }
.silva-toast-close:hover { color: #fff; }

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

    .silva-auth-container {
        background: #f0f4f8;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
    }

    .silva-auth-content {
        max-width: 440px;
        width: 100%;
        border-radius: 16px;
        padding: 2.5rem 2rem;
        box-shadow: 0 8px 32px rgba(0,0,0,.1);
    }
}

@media (max-width: 480px) {
    .silva-auth-content { padding: 2rem 1.25rem; }
    .silva-auth-header h2 { font-size: 1.5rem; }
}


/* Brand Name */
.silva-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: #014385;
    letter-spacing: 0.075em;
    margin: 0 0 1rem 0;
    font-family: var(--font-poppins);
}

/* Header */
.silva-auth-header {
    margin-bottom: 1.25rem;
}

.silva-auth-header h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: #014385;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    font-family: var(--font-poppins);
}

.silva-auth-header p {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
    font-family: var(--font-poppins);
}

/* Messages */
.silva-auth-message {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-left: 3px solid;
    font-family: var(--font-poppins);
}

.silva-auth-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.silva-auth-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

/* Form */
.silva-auth-form {
    width: 100%;
    text-align: left;
}

.silva-form-group {
    margin-bottom: 0.875rem;
}

.silva-form-group label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-family: var(--font-poppins);
}

.silva-form-control {
    width: 100%;
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: var(--font-poppins);
}

.silva-form-control:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.silva-form-control:focus {
    outline: none;
    border-color: #014385;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(1, 67, 133, 0.1);
}

.silva-form-control::placeholder {
    color: #94a3b8;
}

/* Password Toggle */
.silva-password-wrapper {
    position: relative;
}

.silva-password-wrapper .silva-form-control {
    padding-right: 3rem;
}

.silva-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    transform: none;
    background: transparent;
    border: none;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    padding: 0;
    color: #6b7280;
    transition: color 0.2s ease;
    height: 100%;
    width: 2.75rem;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.silva-password-toggle:hover {
    color: #6b7280;
    background: transparent;
}

.silva-password-toggle:focus {
    outline: none;
    background: transparent;
}

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

/* Checkbox */
.silva-form-checkbox {
    margin-bottom: 1rem;
}

.silva-form-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.875rem;
}

.silva-form-checkbox input {
    margin-right: 0.5rem;
    accent-color: #014385;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Buttons */
.silva-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-poppins);
    text-decoration: none;
    display: block;
    box-shadow: none;
}

.silva-btn-primary {
    background: #014385;
    color: #ffffff;
    box-shadow: none;
}

.silva-btn-primary:hover {
    background: #0A5CAA;
    transform: none;
    box-shadow: none;
}

.silva-btn-primary:active {
    transform: none;
}

.silva-btn-secondary {
    background: transparent;
    color: #014385;
    border: 2px solid #014385;
}

.silva-btn-secondary:hover {
    background: #014385;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 67, 133, 0.2);
}

/* Links */
.silva-auth-links {
    text-align: center;
    margin-top: 0.875rem;
    font-size: 0.875rem;
}

.silva-link {
    color: #014385;
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-poppins);
}

.silva-link:hover {
    color: #0A5CAA;
    text-decoration: underline;
}

/* Footer - Signup Section */
.silva-auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
}

.silva-auth-footer span {
    margin-right: 0.375rem;
}

.silva-signup-link {
    color: #014385;
    text-decoration: none;
    font-weight: 600;
}

.silva-signup-link:hover {
    color: #0A5CAA;
    text-decoration: underline;
}

/* Responsive Design */

/* Tablet Landscape & Small Desktops (768px - 1024px) */
@media (max-width: 1024px) {
    .silva-auth-container {
        padding: 2rem 1.5rem;
    }
    
    .silva-auth-content {
        max-width: 400px;
    }
}

/* Tablet Portrait (641px - 768px) */
@media (max-width: 768px) {
    .silva-auth-container {
        padding: 1.75rem 1.25rem;
    }
    
    .silva-logo-circle {
        width: 90px;
        height: 90px;
        margin-bottom: 1.25rem;
    }
    
    .silva-brand-name {
        font-size: 1.0625rem;
        margin-bottom: 1.75rem;
    }
    
    .silva-auth-header h2 {
        font-size: 1.625rem;
    }
    
    .silva-auth-header p {
        font-size: 0.8125rem;
    }
}

/* Mobile Devices (375px - 640px) */
@media (max-width: 640px) {
    .silva-auth-container {
        padding: 1.5rem 1rem;
    }
    
    .silva-logo-circle {
        width: 85px;
        height: 85px;
        margin-bottom: 1.25rem;
        padding: 1rem;
    }
    
    .silva-brand-name {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .silva-auth-header {
        margin-bottom: 1.5rem;
    }
    
    .silva-auth-header h2 {
        font-size: 1.5rem;
    }
    
    .silva-auth-header p {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
    
    .silva-form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8125rem 0.875rem;
    }
    
    .silva-btn {
        padding: 0.9375rem 1.5rem;
    }
    
    .silva-form-group {
        margin-bottom: 1rem;
    }
}

/* Small Mobile Devices (below 375px) */
@media (max-width: 374px) {
    .silva-auth-container {
        padding: 1rem 0.75rem;
    }
    
    .silva-logo-circle {
        width: 75px;
        height: 75px;
        padding: 0.875rem;
    }
    
    .silva-brand-name {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
    }
    
    .silva-auth-header h2 {
        font-size: 1.375rem;
    }
    
    .silva-auth-header p {
        font-size: 0.75rem;
    }
    
    .silva-form-control {
        padding: 0.75rem 0.75rem;
    }
    
    .silva-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .silva-auth-footer {
        font-size: 0.8125rem;
    }
}

/* Landscape Mode on Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .silva-auth-container {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .silva-logo-circle {
        width: 70px;
        height: 70px;
        margin-bottom: 0.75rem;
    }
    
    .silva-brand-name {
        margin-bottom: 1rem;
        font-size: 0.9375rem;
    }
    
    .silva-auth-header {
        margin-bottom: 1rem;
    }
    
    .silva-auth-header h2 {
        font-size: 1.375rem;
        margin-bottom: 0.5rem;
    }
    
    .silva-auth-header p {
        font-size: 0.75rem;
    }
    
    .silva-form-group {
        margin-bottom: 0.75rem;
    }
    
    .silva-form-control {
        padding: 0.625rem 0.75rem;
    }
    
    .silva-btn {
        padding: 0.75rem 1.25rem;
    }
    
    .silva-auth-footer {
        margin-top: 1rem;
    }
}

/* Toast Notifications */
.silva-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.silva-toast {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 0.75rem;
    min-width: 300px;
    animation: silvaToastIn 0.3s ease-out;
    border-left: 4px solid #014385;
}

.silva-toast.success { border-left-color: #22c55e; }
.silva-toast.error { border-left-color: #ef4444; }

@keyframes silvaToastIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
