/* ====================================================================
   LOGIN PAGE  –  The Vintage Artefacts
   Full redesign: premium, brand-aligned, mobile-first
   ==================================================================== */

/* ── Reset / base ───────────────────────────────────────────────────── */
.login-page-body {
    background: #f0f2f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Minimal header (login page only) ──────────────────────────────── */
.login-page-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf4;
    padding: 14px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-page-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
    transition: box-shadow 0.25s, transform 0.25s;
}

.login-page-logo:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.login-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: brightness(1.15) drop-shadow(0 1px 3px rgba(0,0,0,.2));
}

/* ── Main layout ────────────────────────────────────────────────────── */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 480px 440px;
    gap: 0;
    max-width: 960px;
    width: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(102, 126, 234, 0.18), 0 4px 20px rgba(0,0,0,.08);
    overflow: hidden;
}

/* ── Auth (left) panel ──────────────────────────────────────────────── */
.auth-panel {
    padding: 48px 44px;
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* ── Auth brand heading ──────────────────────────────────────────────── */
.auth-brand {
    margin-bottom: 28px;
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
    transition: all 0.3s ease;
}

.auth-subtitle {
    font-size: 14px;
    color: #8492a6;
    margin: 0;
}

/* ── Alert ───────────────────────────────────────────────────────────── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
    animation: alertIn 0.25s ease;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-alert i { margin-top: 2px; flex-shrink: 0; }

.auth-alert.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.auth-alert.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert.info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Social grid — single button (Google only) ───────────────────────── */
.social-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.social-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1.5px solid #e4e8f0;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.social-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102,126,234,.06) 0%, rgba(118,75,162,.06) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.social-tile:hover {
    border-color: #667eea;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    color: #1a202c;
}

.social-tile:hover::before { opacity: 1; }
.social-tile:active { transform: translateY(0); box-shadow: none; }

/* Icons inside tiles */
.tile-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.tile-icon-fa {
    font-size: 22px;
    line-height: 1;
}

.github-tile .tile-icon-fa { color: #24292e; }

/* ── Divider ─────────────────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 20px;
    color: #b0bac9;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

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

/* ── Form fields ─────────────────────────────────────────────────────── */
.auth-form-wrap {
    /* no extra padding needed */
}

.field-group {
    margin-bottom: 18px;
}

.field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

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

.field-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.field-wrap input {
    width: 100%;
    padding: 11px 44px 11px 40px;
    border: 1.5px solid #e0e4ee;
    border-radius: 10px;
    font-size: 14px;
    color: #1a202c;
    background: #fafbff;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    box-sizing: border-box;
}

.field-wrap input::placeholder { color: #c3c9d9; }

.field-wrap input:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* Eye toggle */
.field-eye {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    border: none;
    background: transparent;
    color: #c3c9d9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 1;
}

.field-eye:hover { color: #667eea; }

/* ── Submit button ───────────────────────────────────────────────────── */
.auth-submit-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.2px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    margin-top: 4px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ── Toggle sign-in / sign-up ────────────────────────────────────────── */
.auth-mode-toggle {
    text-align: center;
    font-size: 13.5px;
    color: #8492a6;
    margin: 16px 0 0;
}

.toggle-link {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 0 0 4px;
    transition: color 0.2s;
}

.toggle-link:hover { color: #5a67d8; text-decoration: underline; }

/* ── Loading overlay ─────────────────────────────────────────────────── */
.auth-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 20;
    border-radius: 24px 0 0 24px;
}

.auth-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e0e4ee;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.auth-loading p {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

/* ── Secure badge ────────────────────────────────────────────────────── */
.secure-badge {
    text-align: center;
    font-size: 11.5px;
    color: #b0bac9;
    margin: 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.secure-badge i { color: #52c41a; font-size: 11px; }

/* ── Benefits (right) panel ──────────────────────────────────────────── */
.benefits-panel {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    padding: 52px 44px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Decorative blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    background: #fff;
    pointer-events: none;
}

.blob-1 {
    width: 280px; height: 280px;
    top: -80px; right: -80px;
}

.blob-2 {
    width: 200px; height: 200px;
    bottom: -60px; left: -60px;
}

.benefits-inner {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Brand block */
.benefits-brand {
    margin-bottom: 36px;
}

.benefits-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,.2));
    margin-bottom: 10px;
}

.benefits-tagline {
    color: rgba(255,255,255,.75);
    font-size: 13px;
    font-style: italic;
    margin: 0;
}

/* Benefit list */
.benefit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    animation: fadeSlide 0.4s ease both;
}

.benefit-item:last-child { border-bottom: none; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.benefit-item:nth-child(1) { animation-delay: 0.05s; }
.benefit-item:nth-child(2) { animation-delay: 0.12s; }
.benefit-item:nth-child(3) { animation-delay: 0.19s; }
.benefit-item:nth-child(4) { animation-delay: 0.26s; }

.benefit-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.benefit-icon i {
    font-size: 17px;
    color: #fff;
}

.benefit-item strong {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
}

.benefit-item p {
    color: rgba(255,255,255,.7);
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

/* ── login-step display logic (reused in modal too) ─────────────────── */
.login-step        { display: none; }
.login-step.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ── Hidden utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ====================================================================
   MODAL (in-page) – Social grid + form styles
   ==================================================================== */

/* Single-button social grid inside modal (Google only) */
.modal-social-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

/* Row-layout tile for single-button modal */
.modal-social-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1.5px solid #e4e8f0;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-social-tile:hover {
    border-color: #667eea;
    background: #f5f7ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.modal-social-tile .tile-icon     { width: 20px; height: 20px; flex-shrink: 0; }
.modal-social-tile .tile-icon-fa  { font-size: 19px; }

/* Modal alert – inline flow (not absolute) */
.modal-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
    animation: alertIn 0.25s ease;
}

.modal-alert i { margin-top: 1px; flex-shrink: 0; }

.modal-alert.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.modal-alert.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.modal-alert.info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Modal divider */
.modal-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 16px;
    color: #b0bac9;
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Modal password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.password-wrapper input {
    width: 100%;
    padding-right: 44px !important;
}

.toggle-password {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 40px;
    border: none; background: transparent;
    color: #c3c9d9;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
}

.toggle-password:hover { color: #667eea; }

/* Modal sign-in/sign-up toggle */
.auth-toggle {
    text-align: center;
    font-size: 13px;
    color: #8492a6;
    margin-top: 14px;
}

.auth-toggle .btn-link {
    font-size: 13px;
    margin-left: 3px;
    font-weight: 700;
    color: #667eea;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.auth-toggle .btn-link:hover { color: #5a67d8; text-decoration: underline; }

/* Modal submit button */
.modal-submit-btn,
.btn.btn-primary.btn-block {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.32);
    margin-top: 2px;
}

.modal-submit-btn:hover,
.btn.btn-primary.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.42);
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .benefits-panel {
        /* Show below the form on tablet */
        order: 2;
        padding: 36px 40px;
    }

    .auth-panel {
        order: 1;
    }

    .auth-loading {
        border-radius: 24px 24px 0 0;
    }
}

@media (max-width: 520px) {
    .login-main { padding: 20px 12px 40px; }

    .auth-panel { padding: 32px 24px; }

    .benefits-panel { padding: 28px 24px; }

    .social-grid { grid-template-columns: 1fr; gap: 8px; }

    .social-tile { padding: 12px 16px; font-size: 13px; }

    .auth-title { font-size: 22px; }

    .login-logo-img { height: 36px; }
}

@media (max-width: 380px) {
    .social-grid { grid-template-columns: 1fr; }
    .social-tile { flex-direction: row; padding: 11px 14px; gap: 10px; }
}
