/* ============================================================
   eMEGA Custom Login Page Styles
   Path: cartridges/app_emega_storefront/cartridge/static/default/css/account/login.css
   NOTE: All rules scoped under .emega-* classes + !important
         to prevent conflicts with SFCC base global styles.
   ============================================================ */


/* ── PAGE WRAPPER ── */
.emega-login-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    width: 100% !important;
    padding: 32px 16px !important;
    background-color: #eef0f3 !important;
    box-sizing: border-box !important;
}


/* ── THE CARD ── */
.emega-login-card {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    max-width: 1040px !important;
    min-height: 600px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14) !important;
    background: #ffffff !important;
    margin: 0 auto !important;
}


/* ============================================================
   LEFT PANEL — Brand Image
   ============================================================ */
.emega-brand-panel {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    /* padding-left: 50px !important; */
    min-height: 600px !important;
}

.emega-brand-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Hide brand panel when emega-no-image class is on card */
.emega-login-card.emega-no-image .emega-brand-panel {
    display: none !important;
}


/* ── No image mode (register + check order tabs) ── */
.emega-login-card.emega-no-image {
    max-width: 560px !important;
    min-height: auto !important;
}

.emega-login-card.emega-no-image .emega-form-panel {
    padding: 44px 52px !important;
    align-items: flex-start !important;
}

.emega-login-card.emega-no-image .emega-form-inner {
    max-width: 100% !important;
}


/* ============================================================
   RIGHT PANEL — Form
   ============================================================ */
.emega-form-panel {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 52px 52px !important;
    background: #ffffff !important;
}

.emega-form-inner {
    width: 100% !important;
    max-width: 400px !important;
}

.emega-form-header {
    margin-bottom: 24px !important;
}

.emega-title {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.2 !important;
}

.emega-subtitle {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 13.5px !important;
    color: #6b7280 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}


/* ============================================================
   SFCC FORM OVERRIDES — scoped to .emega-form-panel
   ============================================================ */

/* Hide nav tabs */
.emega-form-panel .nav.nav-tabs,
.emega-form-panel ul.nav-tabs,
.emega-form-panel .login-form-nav > ul {
    display: none !important;
}

/* Tab pane visibility */
.emega-form-panel .tab-pane {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.emega-form-panel .tab-pane.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Labels */
.emega-form-panel .form-group label,
.emega-form-panel label {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* Inputs */
.emega-form-panel .form-control,
.emega-form-panel input[type="email"],
.emega-form-panel input[type="password"],
.emega-form-panel input[type="text"],
.emega-form-panel input[type="tel"] {
    width: 100% !important;
    height: 48px !important;
    padding: 12px 16px !important;
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 14px !important;
    color: #111827 !important;
    background-color: #f0f4fa !important;
    border: 1.5px solid transparent !important;
    border-radius: 8px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

.emega-form-panel .form-control:focus,
.emega-form-panel input[type="email"]:focus,
.emega-form-panel input[type="password"]:focus,
.emega-form-panel input[type="text"]:focus,
.emega-form-panel input[type="tel"]:focus {
    background-color: #ffffff !important;
    border-color: #d7201e !important;
    box-shadow: 0 0 0 3px rgba(215, 32, 30, 0.12) !important;
    outline: none !important;
}

.emega-form-panel .form-control::placeholder,
.emega-form-panel input::placeholder {
    color: #9ca3af !important;
    font-size: 14px !important;
}

/* Form groups */
.emega-form-panel .form-group {
    margin-bottom: 18px !important;
}

/* ── REMEMBER ME + FORGOT PASSWORD — same row ── */
/* SFCC loginForm renders these as two sibling .form-group divs:
   1st: .form-group.custom-control.custom-checkbox  (Remember me)
   2nd: .form-group (Forgot password link)
   We use a flex wrapper on their shared parent to align them. */

.emega-form-panel #emega-login-tab .login-form-fields,
.emega-form-panel #emega-login-tab form {
    display: block !important;
}

/* Target the specific row: checkbox group + forgot password group side by side */
.emega-form-panel #emega-login-tab .form-group.custom-checkbox {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    margin-bottom: 16px !important;
    float: left !important;
}

.emega-form-panel #emega-login-tab .forgot-password {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    float: right !important;
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

/* Clearfix after the two floated elements */
.emega-form-panel #emega-login-tab .forgot-password::after {
    content: '' !important;
    display: table !important;
    clear: both !important;
}

/* Forgot password link style */
.emega-form-panel .forgot-password a,
.emega-form-panel a.forgot-password-link,
.emega-form-panel a[href*="ResetPassword"] {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 13px !important;
    color: #d7201e !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

.emega-form-panel .forgot-password a:hover,
.emega-form-panel a.forgot-password-link:hover {
    text-decoration: underline !important;
    color: #b81b19 !important;
}

/* Clearfix on the form itself so floats don't break layout */
.emega-form-panel #emega-login-tab form::after {
    content: '' !important;
    display: table !important;
    clear: both !important;
}


/* ── BUTTONS ── */
.emega-form-panel .btn.btn-primary.btn-block,
.emega-form-panel button[type="submit"].btn-block,
.emega-form-panel input[type="submit"].btn-block,
.emega-form-panel .btn-block {
    width: 100% !important;
    height: 54px !important;
    background-color: #d7201e !important;
    background-image: none !important;
    border: none !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
    margin-top: 8px !important;
    box-shadow: 0 4px 14px rgba(215, 32, 30, 0.35) !important;
    line-height: 1 !important;
    text-align: center !important;
    display: block !important;
    clear: both !important;
}

.emega-form-panel .btn.btn-primary.btn-block:hover,
.emega-form-panel button[type="submit"].btn-block:hover {
    background-color: #b81b19 !important;
    box-shadow: 0 6px 20px rgba(215, 32, 30, 0.45) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

.emega-form-panel .btn.btn-primary.btn-block:active,
.emega-form-panel button[type="submit"].btn-block:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(215, 32, 30, 0.3) !important;
}

/* Validation errors */
.emega-form-panel .invalid-feedback {
    font-size: 12px !important;
    color: #d7201e !important;
    margin-top: 4px !important;
    display: block !important;
}

.emega-form-panel .form-control.is-invalid {
    border-color: #d7201e !important;
    background-color: #fff5f5 !important;
}

/* Alert messages */
.emega-form-panel .alert {
    border-radius: 8px !important;
    font-size: 13px !important;
    padding: 12px 16px !important;
    margin-bottom: 16px !important;
}

.emega-form-panel .alert-danger {
    background-color: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
}

/* Checkbox accent */
.emega-form-panel .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #d7201e !important;
    border-color: #d7201e !important;
}

/* Remove card styling from base */
.emega-form-panel .card,
.emega-form-panel .card-body,
.emega-brand-panel .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* ── Action links container ── */
.emega-form-panel .emega-action-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 18px !important;
}

.emega-form-panel .emega-action-links .emega-signup-row {
    margin-top: 0 !important;
}

/* ── Sign Up / Switch Row ── */
.emega-form-panel .emega-signup-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-top: 18px !important;
}

.emega-form-panel .emega-signup-text {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

.emega-form-panel .emega-signup-link {
    font-family: Arial, 'Helvetica Neue', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #d7201e !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease, color 0.2s ease !important;
}

.emega-form-panel .emega-signup-link:hover {
    color: #b81b19 !important;
    border-bottom-color: #b81b19 !important;
    text-decoration: none !important;
}


/* ============================================================
   CREATE ACCOUNT — First Name + Last Name in one flex row
   ============================================================ */

.emega-form-panel #emega-register-tab .registration {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0 12px !important;
}

/* All form-groups full width by default */
.emega-form-panel #emega-register-tab .registration .form-group {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 14px !important;
}

/* First Name + Last Name — half width each */
.emega-form-panel #emega-register-tab .registration .form-group:nth-child(1),
.emega-form-panel #emega-register-tab .registration .form-group:nth-child(2) {
    flex: 1 1 calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
    min-width: 0 !important;
}

/* Tighter inputs on register */
.emega-form-panel #emega-register-tab .form-control,
.emega-form-panel #emega-register-tab input[type="text"],
.emega-form-panel #emega-register-tab input[type="email"],
.emega-form-panel #emega-register-tab input[type="password"],
.emega-form-panel #emega-register-tab input[type="tel"] {
    height: 42px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
}

/* Smaller labels */
.emega-form-panel #emega-register-tab label,
.emega-form-panel #emega-register-tab .form-group label {
    font-size: 12px !important;
    margin-bottom: 4px !important;
}

/* Privacy policy */
.emega-form-panel #emega-register-tab .privacy-policy {
    font-size: 11px !important;
    color: #6b7280 !important;
    margin-top: 8px !important;
    line-height: 1.4 !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.emega-form-panel #emega-register-tab .privacy-policy a {
    color: #d7201e !important;
    text-decoration: none !important;
}

.emega-form-panel #emega-register-tab .privacy-policy a:hover {
    text-decoration: underline !important;
}


/* ============================================================
   TRACK ORDER — hide duplicate title + description
   ============================================================ */
.emega-trackorder-wrap .card-header,
.emega-trackorder-wrap h2.track-order-header,
.emega-trackorder-wrap .track-order-header-text,
.emega-trackorder-wrap p.track-order-header-text {
    display: none !important;
}

.emega-trackorder-wrap .card-body {
    padding: 0 !important;
}

.emega-trackorder-wrap form {
    padding: 0 !important;
}


/* ============================================================
   RESPONSIVE — Mobile/Tablet: hide image, single column
   ============================================================ */
@media (max-width: 900px) {

    /* Hide brand image panel on mobile/tablet */
    .emega-brand-panel,
    .emega-login-card .emega-brand-panel,
    #emega-brand-panel {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        flex: none !important;
        max-width: 0 !important;
        overflow: hidden !important;
    }

    .emega-login-card {
        flex-direction: column !important;
        min-height: auto !important;
        max-width: 480px !important;
    }

    .emega-form-panel {
        padding: 36px 28px !important;
        align-items: flex-start !important;
    }

    .emega-form-inner {
        max-width: 100% !important;
    }

    .emega-title {
        font-size: 24px !important;
    }

    /* Stack name fields on mobile */
    .emega-form-panel #emega-register-tab .registration .form-group:nth-child(1),
    .emega-form-panel #emega-register-tab .registration .form-group:nth-child(2) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}