/* Shared Authentication Styles for ReLoop */

:root {
    --auth-bg: #050505;
    --auth-form-bg: #050505;
    --auth-accent: #4ade80;
    --auth-text-dim: rgba(255, 255, 255, 0.5);
    --auth-input-bg: rgba(255, 255, 255, 0.05);
    --auth-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--auth-bg);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Form Side */
.auth-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    background: var(--auth-form-bg);
    position: relative;
    max-width: 50vw;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

/* Visual Side */
.auth-visual-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.auth-visual-side video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.visual-overlay-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #000;
    font-weight: 500;
}

.visual-overlay-card .arrow-btn {
    width: 32px;
    height: 32px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Typography & Elements */
.auth-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.auth-form-container h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--auth-text-dim);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    padding: 14px 20px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--auth-accent);
}

.forgot-link {
    display: block;
    font-size: 0.875rem;
    color: var(--auth-text-dim);
    text-decoration: none;
    margin-top: 8px;
}

.forgot-link:hover {
    color: #fff;
}

.btn-auth-primary {
    width: 100%;
    background: #2a2a2a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s ease;
}

.btn-auth-primary:hover {
    background: #3a3a3a;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--auth-text-dim);
}

.auth-switch a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    color: var(--auth-text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.divider span {
    padding: 0 16px;
}

.btn-google {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.btn-google:hover {
    border-color: #fff;
}

.btn-google svg {
    width: 18px;
    height: 18px;
}

.auth-legal {
    margin-top: 40px;
    font-size: 0.75rem;
    color: var(--auth-text-dim);
    text-align: center;
    line-height: 1.6;
}

/* Back to Home Button (Inverted Style) */
.btn-back-home {
    position: absolute;
    top: 40px;
    left: 40px;
    height: 52px;
    padding: 6px 32px 6px 6px;
    /* Swapped padding for left-pointing button */
    background: #1a1a1a;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    flex-direction: row-reverse;
    /* Put icon on the left */
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.btn-back-home:hover {
    transform: scale(1.05);
    background: #222;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-back-home-icon {
    width: 40px;
    height: 40px;
    background: var(--auth-accent);
    /* #4ade80 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-back-home-icon svg {
    width: 16px;
    height: 16px;
    stroke: #000;
}

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

/* Tablet breakpoint (768px - 1024px) */
@media (max-width: 1024px) {
    .auth-visual-side {
        display: none;
    }

    .auth-form-side {
        max-width: 100%;
        padding: 80px 32px 40px;
    }

    .btn-back-home {
        top: 20px;
        left: 20px;
        height: 48px;
        padding: 4px 24px 4px 4px;
        font-size: 0.9rem;
        gap: 12px;
    }

    .btn-back-home-icon {
        width: 38px;
        height: 38px;
    }
}

/* Mobile breakpoint (max-width: 768px) */
@media (max-width: 768px) {
    .auth-form-side {
        padding: 70px 24px 32px;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .auth-form-container h1 {
        font-size: 1.625rem;
        margin-bottom: 24px;
    }

    .auth-logo {
        font-size: 1.25rem;
        margin-bottom: 32px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .input-field {
        padding: 12px 18px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    .btn-auth-primary,
    .btn-google {
        padding: 12px;
        font-size: 0.9375rem;
    }

    .divider {
        margin: 24px 0;
    }

    .btn-back-home {
        position: fixed;
        top: 16px;
        left: 16px;
        height: 44px;
        padding: 4px 20px 4px 4px;
        font-size: 0.875rem;
        gap: 10px;
        z-index: 1000;
    }

    .btn-back-home-icon {
        width: 34px;
        height: 34px;
    }

    .btn-back-home-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* Small mobile breakpoint (max-width: 480px) */
@media (max-width: 480px) {
    .auth-form-side {
        padding: 64px 16px 24px;
    }

    .auth-form-container h1 {
        font-size: 1.375rem;
        margin-bottom: 20px;
        line-height: 1.3;
    }

    .auth-logo {
        font-size: 1.125rem;
        margin-bottom: 24px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 0.8125rem;
        margin-bottom: 6px;
    }

    .input-field {
        padding: 11px 16px;
        border-radius: 6px;
    }

    .btn-auth-primary,
    .btn-google {
        padding: 11px;
        border-radius: 6px;
        font-size: 0.875rem;
        min-height: 48px;
        /* Touch target */
    }

    .auth-switch {
        font-size: 0.8125rem;
        margin-top: 12px;
    }

    .divider {
        margin: 20px 0;
        font-size: 0.6875rem;
    }

    .divider span {
        padding: 0 12px;
    }

    /* Improve touch target for forgot password link */
    .forgot-link {
        display: inline-block;
        padding: 8px 0;
        margin-top: 4px;
        font-size: 0.8125rem;
    }

    .btn-back-home {
        top: 12px;
        left: 12px;
        height: 40px;
        padding: 3px 16px 3px 3px;
        font-size: 0.8rem;
        gap: 8px;
    }

    .btn-back-home-icon {
        width: 32px;
        height: 32px;
    }

    .btn-back-home-icon svg {
        width: 12px;
        height: 12px;
    }

    .auth-legal {
        margin-top: 24px;
        font-size: 0.6875rem;
    }
}

/* Extra small screens (max-width: 360px) */
@media (max-width: 360px) {
    .auth-form-side {
        padding: 56px 12px 20px;
    }

    .auth-form-container h1 {
        font-size: 1.25rem;
    }

    .auth-logo {
        font-size: 1rem;
    }

    .btn-back-home {
        top: 8px;
        left: 8px;
        height: 36px;
        padding: 2px 12px 2px 2px;
        font-size: 0.75rem;
    }

    .btn-back-home-icon {
        width: 30px;
        height: 30px;
    }

    .input-field {
        padding: 10px 14px;
        font-size: 16px;
    }

    .btn-auth-primary,
    .btn-google {
        padding: 10px;
        font-size: 0.8125rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .auth-switch a {
        display: inline-block;
        padding: 8px 4px;
        margin: -8px -4px;
    }

    .forgot-link {
        padding: 12px 0;
        margin-top: 0;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .auth-form-side {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .btn-back-home {
        left: max(16px, env(safe-area-inset-left));
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-form-side {
        padding-top: 50px;
        padding-bottom: 20px;
    }

    .auth-logo {
        margin-bottom: 16px;
    }

    .auth-form-container h1 {
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .divider {
        margin: 16px 0;
    }

    .btn-back-home {
        top: 10px;
    }

    .auth-legal {
        margin-top: 16px;
    }
}