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

:root {
    --auth-primary: #fa6400;
    --auth-primary-hover: #e05500;
    --auth-primary-50: #fff0e5;
    --auth-primary-100: #ffd8be;
    --auth-primary-glow: rgba(250, 100, 0, 0.18);
    --auth-blue: #487fff;
    --auth-heading: #121535;
    --auth-text-main: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-border-focus: #fa6400;
    --auth-bg-light: #f8fafc;
    --auth-success: #16a34a;
    --auth-warning: #f59e0b;
    --auth-danger: #dc2626;
    --auth-radius: 8px;
    --auth-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.login {
    font-family: var(--auth-font) !important;
    background-color: var(--auth-bg-light);
    color: var(--auth-text-main);
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    display: block !important;
}

body.login #content.main,
body.login .main {
    width: 100% !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Split Screen Layout Container */
.auth-split-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
}

/* Left Hero Section with the SVG background (Stationary / Fixed) */
.auth-hero-side {
    position: relative;
    flex: 0 0 42%;
    max-width: 42%;
    height: 100vh;
    overflow: hidden;
    background-color: #121535;
    background-image: linear-gradient(160deg, rgba(18, 21, 53, 0.88) 0%, rgba(18, 21, 53, 0.94) 100%), url('../img/tudo-lanka.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem 3.5rem;
    z-index: 1;
}

.auth-hero-brand {
    margin-bottom: 2rem;
}

.auth-hero-brand img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-hero-content {
    max-width: 440px;
}

.auth-hero-tag {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fa6400;
    margin-bottom: 0.75rem;
}

.auth-hero-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.auth-hero-content p.hero-subtitle {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
}

/* Two Clean Hero Feature Cards */
.auth-hero-cards {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.auth-hero-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--auth-radius);
    padding: 0.95rem 1.1rem;
    backdrop-filter: blur(8px);
}

.auth-hero-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(250, 100, 0, 0.15);
    border: 1px solid rgba(250, 100, 0, 0.25);
    color: #fa6400;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.auth-hero-card-body {
    display: flex;
    flex-direction: column;
}

.auth-hero-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.auth-hero-card-desc {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0;
}

/* Simple, clean footer on hero side */
.auth-hero-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-hero-managed {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.auth-hero-managed img {
    height: 22px;
    width: auto;
    border-radius: 4px;
    opacity: 0.85;
}

/* Right Form Section (Independently Scrollable) */
.auth-form-side {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3.5rem 2rem;
    background-color: #ffffff;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
}

.auth-form-container.wide {
    max-width: 580px;
    margin: auto 0;
}

/* Top Header */
.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-logo {
    display: none;
    margin-bottom: 1.5rem;
}

.auth-form-logo img {
    height: 38px;
    width: auto;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-heading);
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.01em;
}

.auth-form-subtitle {
    font-size: 0.92rem;
    color: var(--auth-text-muted);
    margin: 0;
}

.auth-form-subtitle a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-form-subtitle a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Form Styles */
.auth-form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.auth-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-heading);
    margin-bottom: 0.4rem;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.auth-input-icon svg {
    width: 18px;
    height: 18px;
}

.auth-control {
    width: 100%;
    height: 46px;
    padding: 0.6rem 0.95rem 0.6rem 2.75rem;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--auth-text-main);
    background-color: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.auth-control:hover {
    border-color: #cbd5e1;
}

.auth-control:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px var(--auth-primary-glow);
}

.auth-input-wrapper.has-toggle .auth-control {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
    z-index: 2;
}

.auth-password-toggle:hover {
    color: var(--auth-text-main);
}

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
}

/* Input Status Feedback (e.g. Shop Name duplicate check) */
.auth-input-status {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.auth-status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--auth-primary);
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

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

.auth-field-feedback {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.auth-feedback-success {
    color: var(--auth-success);
}

.auth-feedback-danger {
    color: var(--auth-danger);
}

/* Choice Cards for Sign Up */
.auth-choice-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.auth-choice-label {
    margin: 0;
    cursor: pointer;
    display: block;
}

.auth-choice-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-choice-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    background-color: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transition: all 0.15s ease;
    user-select: none;
}

.auth-choice-card:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.auth-choice-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-choice-icon svg {
    width: 17px;
    height: 17px;
}

.auth-choice-meta {
    display: flex;
    flex-direction: column;
}

.auth-choice-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--auth-text-main);
    line-height: 1.2;
}

.auth-choice-desc {
    font-size: 0.72rem;
    color: var(--auth-text-muted);
    margin-top: 1px;
}

.auth-choice-label input[type="radio"]:checked+.auth-choice-card {
    border-color: var(--auth-primary);
    background-color: var(--auth-primary-50);
}

.auth-choice-label input[type="radio"]:checked+.auth-choice-card .auth-choice-icon {
    background-color: var(--auth-primary);
    color: #ffffff;
}

.auth-choice-label input[type="radio"]:checked+.auth-choice-card .auth-choice-title {
    color: var(--auth-primary);
}

/* Password Strength Indicator */
.auth-strength-meter {
    margin-top: 0.45rem;
}

.auth-strength-bars {
    display: flex;
    gap: 4px;
    height: 3px;
    margin-bottom: 3px;
}

.auth-strength-bar {
    flex: 1;
    background-color: #e2e8f0;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.auth-strength-text {
    font-size: 0.72rem;
    color: var(--auth-text-muted);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.auth-strength-bar.active-weak {
    background-color: var(--auth-danger);
}

.auth-strength-bar.active-fair {
    background-color: var(--auth-primary);
}

.auth-strength-bar.active-good {
    background-color: var(--auth-warning);
}

.auth-strength-bar.active-strong {
    background-color: var(--auth-success);
}

/* Checkbox & Links */
.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    font-size: 0.85rem;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.auth-checkbox-label input[type="checkbox"] {
    accent-color: var(--auth-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-forgot-link {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
}

.auth-forgot-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Primary Button (Tudo Orange) */
.btn-auth-primary {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--auth-primary);
    color: #ffffff !important;
    border: none;
    border-radius: var(--auth-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

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

.btn-auth-primary:active {
    transform: translateY(1px);
}

/* Grid layout helpers */
.auth-row {
    display: flex;
    gap: 1rem;
}

.auth-col-6 {
    flex: 1;
    min-width: 0;
}

/* Alert styling */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.auth-alert svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.auth-alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.auth-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #15803d;
}

/* Scroll cue button for mobile on sign up */
.auth-mobile-scroll-cue {
    display: none;
}

.auth-scroll-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--auth-primary);
    color: #ffffff !important;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(250, 100, 0, 0.4);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.auth-scroll-btn svg {
    animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(4px);
    }

    60% {
        transform: translateY(2px);
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .auth-split-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    /* Pages with auth-hide-hero-mobile (Login, Forgot PW): hide hero on mobile */
    .auth-hero-side.auth-hide-hero-mobile {
        display: none !important;
    }

    /* Pages keeping hero (Sign Up): compact padding and show scroll cue */
    .auth-hero-side {
        flex: 0 0 auto;
        max-width: 100%;
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 2.5rem 1.5rem 2rem 1.5rem;
    }

    .auth-hero-content h1 {
        font-size: 1.6rem;
    }

    .auth-hero-cards {
        margin-top: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .auth-mobile-scroll-cue {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
    }

    .auth-hero-footer {
        display: none;
    }

    .auth-form-side {
        height: auto;
        min-height: auto;
        overflow-y: visible;
        padding: 2.5rem 1.5rem;
    }

    .auth-form-container,
    .auth-form-container.wide {
        margin: 0 auto;
    }

    /* Hide inside-form logo on mobile if hero is showing */
    .auth-form-logo {
        display: none;
    }

    /* Show inside-form logo on mobile if hero is hidden (Login page) */
    .auth-hero-side.auth-hide-hero-mobile+.auth-form-side .auth-form-logo {
        display: block !important;
    }
}

@media (max-width: 767.98px) {
    .auth-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 575.98px) {
    .auth-choice-group {
        grid-template-columns: 1fr;
    }
}