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

:root {
    --ig-blue: #0095f6;
    --ig-blue-hover: #1877f2;
    --ig-bg: #fafafa;
    --ig-border: #dbdbdb;
    --ig-text-primary: #262626;
    --ig-text-secondary: #8e8e8e;
    --white: #ffffff;
    --error-red: #ed4956;
    --success-green: #47b881;
    --radius: 3px; /* Instagram uses very small radius for the login card */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)), url('../gallery/login.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-main-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 850px;
    gap: 32px;
}

.auth-imagery-desktop {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 380px;
}

.auth-main-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .auth-imagery-desktop {
        display: none;
    }
}

.auth-container {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-card {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(219, 219, 219, 0.7);
    padding: 10px 40px 20px;
    text-align: center;
    border-radius: 12px;
}

.auth-header {
    margin: 36px 0 12px;
}

.auth-header h1 {
    font-family: 'Grand Hotel', cursive;
    font-size: 3.5rem;
    color: var(--ig-text-primary);
    margin-bottom: 20px;
    font-weight: 400;
}

.auth-header p {
    color: var(--ig-text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 6px;
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid var(--ig-border);
    background: #fafafa;
    border-radius: 3px;
    font-size: 0.8rem;
    outline: none;
    color: var(--ig-text-primary);
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: #a8a8a8;
}

.form-group input::placeholder {
    color: var(--ig-text-secondary);
    font-size: 0.75rem;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ig-text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
}

.auth-btn {
    width: 100%;
    background-color: var(--ig-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s;
}

.auth-btn:hover {
    background-color: var(--ig-blue-hover);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-btn.is-loading,
.social-auth-btn.is-loading {
    pointer-events: none;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: currentColor;
    border-radius: 999px;
    display: none;
    animation: authSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.auth-btn.is-loading .auth-spinner,
.social-auth-btn.is-loading .auth-spinner {
    display: inline-block;
}

.auth-btn.is-loading .auth-btn__label,
.social-auth-btn.is-loading .social-auth-btn__icon {
    display: none;
}

.social-auth-btn {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    padding: 0.88rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.78rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-auth-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(14, 165, 233, 0.34);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
}

.social-auth-btn:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.22);
    outline-offset: 2px;
}

.social-auth-btn:disabled {
    cursor: not-allowed;
    opacity: 0.74;
}

.social-auth-btn--soft {
    margin-bottom: 0.25rem;
}

.social-auth-btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.social-auth-btn .auth-spinner {
    border-color: rgba(148, 163, 184, 0.4);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.25rem;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(148, 163, 184, 0.28);
}

.auth-divider--compact {
    margin: 0.9rem 0 1rem;
}

.auth-btn.btn-outline {
    background: transparent;
    color: #385185; /* Instagram's Facebook blue */
    font-weight: 600;
    margin-top: 20px;
    padding: 0;
    box-shadow: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    width: 100%;
}

.auth-btn.btn-outline:hover {
    background: transparent;
    text-decoration: underline;
}

.separator {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ig-border);
}

.separator span {
    margin: 0 18px;
    color: var(--ig-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.forgot-password-link {
    display: block;
    color: #00376b;
    font-size: 0.75rem;
    margin-top: 12px;
    text-decoration: none;
}

.auth-card.secondary {
    padding: 20px;
    margin-top: 10px;
}

.auth-footer {
    font-size: 0.9rem;
    color: var(--ig-text-primary);
}

.auth-footer .toggle-form {
    color: var(--ig-blue);
    font-weight: 600;
    cursor: pointer;
}

/* ═══════════ INSTAGRAM SQUIRCLE AESTHETIC ═══════════ */
.ig-squircle {
    border-radius: 24%; /* Premium squircle shape */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.status-msg {
    margin-bottom: 20px;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: 4px;
}

.status-msg.error {
    color: var(--error-red);
}

.status-msg.success {
    color: var(--success-green);
}

.hidden {
    display: none;
}

.auth-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 18px);
    min-width: min(86vw, 320px);
    max-width: min(90vw, 420px);
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 1100;
}

.auth-toast.success {
    background: rgba(5, 150, 105, 0.94);
}

.auth-toast.error {
    background: rgba(185, 28, 28, 0.94);
}

.auth-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 1200;
}

.auth-modal-backdrop.is-visible {
    opacity: 1;
}

.auth-modal-card {
    width: min(100%, 420px);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.18);
    padding: 1.35rem;
}

.auth-modal-header h2 {
    font-size: 1.18rem;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.auth-modal-header p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.auth-modal-form input {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border: 1px solid #d8e2ec;
    background: #fbfdff;
    border-radius: 12px;
    font-size: 0.92rem;
    color: #0f172a;
}

.auth-modal-form input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
    outline: none;
}

.auth-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1rem;
}

.auth-modal-btn {
    border-radius: 12px;
    padding: 0.76rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.auth-modal-btn.primary {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: #f8fafc;
}

.auth-modal-btn.secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.32);
}

/* Auth Cards Animation */
.auth-container {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes authSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsiveness */

@media (max-width: 450px) {
    body {
        background-color: var(--white);
    }
    .auth-card, .auth-card.secondary {
        border: none;
    }

    .auth-modal-actions {
        flex-direction: column-reverse;
    }

    .auth-modal-btn {
        width: 100%;
    }
}
