/* Modern Login Design System */
:root {
    --primary: var(--primary_color, #2e528e);
    --primary-soft: rgba(46, 82, 142, 0.08);
    --primary-hover: #1d3a6d;
    --bg-light: #f8fafc;
    --border-soft: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-premium);
    position: relative;
    transition: max-width 0.3s ease;
    display: flow-root;
}


.login-card.card-wide {
    max-width: 800px;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Form Styles */
.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-group-modern label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1.25rem;
    top: 26px;
    /* Fixed center point for 52px height input */
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.2s;
}

.form-control-modern {
    width: 100%;
    height: 52px;
    padding: 0 1.25rem 0 3.25rem;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    background: #fff;
}

.form-control-modern:focus+i {
    color: var(--primary);
}

.form-control-modern[readonly],
.form-control-modern[disabled] {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.form-control-modern[readonly]+i,
.form-control-modern[disabled]+i {
    color: #94a3b8;
}



/* Select Styling */
select.form-control-modern {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.25rem;
    padding-right: 3.5rem;
}

textarea.form-control-modern {
    height: auto;
    min-height: 120px;
    padding: 1rem 1.25rem;
}

/* Grid System */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Actions */
.form-submit-outer {
    margin-top: 3rem;
    position: relative;
    z-index: 2;
    float: none;
    /* Clear legacy floats */
    width: 100%;
    display: block;
    padding-bottom: 1rem;
    /* Extra breathing room at bottom */
}


.login-btn-modern {
    width: 100%;
    height: 52px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn-modern:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(46, 82, 142, 0.2);
}

.forgot-password-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary);
}

/* Divider */
.login-divider {
    margin: 3.5rem 0 2.5rem;
    position: relative;
    text-align: center;
    clear: both;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-soft);
}

.login-divider span {
    position: relative;
    background: white;
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Register Section */
.register-section {
    text-align: center;
}

.register-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.register-btn-modern {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.register-btn-modern:hover {
    opacity: 0.8;
}

/* Parsley Overrides */
.parsley-errors-list {
    margin: 4px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    color: #ef4444 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

/* Checkbox Styles */
.checkbox-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    margin: 1rem 0;
}

.checkbox-modern input {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-soft);
    border-radius: 6px;
    appearance: none;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.checkbox-modern input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-modern input:checked::after {
    content: '\f00c';
    font-family: 'FontAwesome';
    position: absolute;
    color: white;
    font-size: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-modern span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.resend-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.resend-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.resend-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .login-card {
        padding: 2.5rem 1.5rem;
        box-shadow: none;
        border-radius: 0;
    }

    .login-form-container {
        padding: 0;
        background: white;
    }
}

/* Multi-step Registration Styles */
.register-section-container {
    padding: 3rem 0;
    background: var(--bg-light);
}

.register-content-outer {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.register-content-outer p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#msform {
    position: relative;
}

#msform fieldset {
    background: white;
    border: 0 none;
    border-radius: 0px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding-bottom: 20px;
    position: relative;
    display: none;
}

#msform fieldset.current {
    display: block;
}

#msform fieldset:not(:first-of-type) {
    display: none;
}

/* Progressbar */
#progressbar {
    margin-bottom: 3.5rem;
    overflow: hidden;
    color: var(--text-muted);
    padding-left: 0;
    display: flex;
    justify-content: space-between;
    counter-reset: step;
}

#progressbar li {
    list-style-type: none;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    position: relative;
    text-align: center;
    z-index: 1;
}

#progressbar li:before {
    content: counter(step);
    counter-increment: step;
    width: 36px;
    height: 36px;
    line-height: 34px;
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: white;
    border: 2px solid var(--border-soft);
    border-radius: 50%;
    margin: 0 auto 10px auto;
    transition: all 0.3s ease;
}

#progressbar li:after {
    content: '';
    width: 100%;
    height: 2px;
    background: var(--border-soft);
    position: absolute;
    left: -50%;
    top: 18px;
    z-index: -1;
    transition: all 0.3s ease;
}

#progressbar li:first-child:after {
    content: none;
}

#progressbar li.active:before,
#progressbar li.active:after {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#progressbar li.active {
    color: var(--primary);
}

/* Form Sections */
.form-card {
    text-align: left;
}

.fs-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

/* Custom Fieldsets */
.form-row-outer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .form-row-outer {
        grid-template-columns: 1fr;
    }
}

.fieldlabels {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.fieldlabels.required:after {
    content: " *";
    color: #ef4444;
}

/* Modern Select2 overrides */
.select2-container--default .select2-selection--single {
    height: 52px !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 1.25rem !important;
    color: var(--text-dark) !important;
    font-size: 0.9375rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px !important;
    right: 1.25rem !important;
}

/* Toggle / Brand selection */
.toggle-outer.brand-selection-email {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
}

.toggle-content-outer ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding-left: 0;
    margin-top: 1rem;
}

.toggle-content-outer li {
    list-style: none;
}

.toggle-content-outer .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Radio button modern styling */
.checkbox-outer {
    display: flex;
    gap: 2rem;
    margin: 1rem 0 2rem;
}

.checkbox-outer input[type="radio"],
.checkbox-outer input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-soft);
    border-radius: 6px;
    appearance: none;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    margin-top: 2px;
}

.checkbox-outer input[type="radio"] {
    border-radius: 50%;
}

.checkbox-outer input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-outer input:checked::after {
    content: '\f00c';
    font-family: 'FontAwesome';
    position: absolute;
    color: white;
    font-size: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-outer label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
}

/* Buttons */
.action-button,
.action-button-previous {
    height: 52px;
    min-width: 140px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    margin-top: 1.5rem;
}

.action-button {
    background: var(--primary);
    color: white;
}

.action-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(46, 82, 142, 0.2);
}

.action-button-previous {
    background: var(--border-soft);
    color: var(--text-muted);
    margin-right: 1rem;
}

.action-button-previous:hover {
    background: #cbd5e1;
    color: var(--text-dark);
}

#terms-popup-trigger {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

/* Preferences & Step 3 Enhancements */
.preference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.preference-card-wrapper {
    position: relative;
}

.preference-card-wrapper input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.preference-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    height: 100%;
}

.preference-card i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.preference-card span {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
}

.preference-card:hover {
    border-color: var(--primary-soft);
    background: var(--bg-light);
    transform: translateY(-2px);
}

.preference-card-wrapper input[type="radio"]:checked+.preference-card {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 10px 15px -3px rgba(46, 82, 142, 0.1);
}

.preference-card-wrapper input[type="radio"]:checked+.preference-card i {
    color: var(--primary);
    transform: scale(1.1);
}

/* Brand Selection Modern Grid */
.brand-selection-modern {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.brand-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-soft);
}

.brand-header-flex .fieldlabels {
    margin-bottom: 0;
}

.select-all-btn {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.select-all-btn:hover {
    background: var(--primary);
    color: white;
}

.brand-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-soft) transparent;
}

.brand-grid-modern::-webkit-scrollbar {
    width: 6px;
}

.brand-grid-modern::-webkit-scrollbar-thumb {
    background-color: var(--primary-soft);
    border-radius: 10px;
}

.brand-item-modern {
    position: relative;
}

.brand-item-modern input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.brand-label-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.brand-label-modern:hover {
    background: white;
    border-color: var(--primary-soft);
    color: var(--text-dark);
}

.brand-item-modern input:checked+.brand-label-modern {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(46, 82, 142, 0.1);
}

.brand-label-modern::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-soft);
    border-radius: 6px;
    background: white;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-item-modern input:checked+.brand-label-modern::before {
    background: var(--primary);
    border-color: var(--primary);
    content: "\f00c";
    font-family: 'FontAwesome';
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Final Checkboxes */
.agreement-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.agreement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.agreement-item:hover {
    border-color: var(--primary-soft);
    background: #fff;
    transform: translateX(4px);
}

.agreement-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.agreement-item span::before {
    content: '';
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-soft);
    border-radius: 6px;
    background: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.agreement-item input:checked+span::before {
    background: var(--primary);
    border-color: var(--primary);
    content: "\f00c";
    font-family: 'FontAwesome';
    color: white;
    font-size: 11px;
}

.agreement-item span {
    font-size: 0.9375rem;
    color: var(--text-dark);
    font-weight: 500;
}

.agreement-item label span {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .preference-grid {
        grid-template-columns: 1fr;
    }
}

/* Submit an Offer Modern Enhancements */
.offer-form-section {
    padding: 4rem 1.5rem;
    background: var(--bg-light);
    min-height: 100vh;
}

.offer-card {
    background: white;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-premium);
    display: flow-root;
    /* Fix for floating children */
}


.section-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 2.5rem 0;
    position: relative;
}

.section-divider span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Product Rows Modern Layout */
.product-details-container {
    margin-bottom: 2rem;
}

.product-row-modern {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.product-row-modern:hover {
    border-color: var(--primary-soft);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04);
}

.product-grid-modern {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.product-grid-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
}

.delete-row-modern {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
    font-size: 0.8rem;
    z-index: 10;
}

.delete-row-modern:hover {
    transform: scale(1.1);
    background: #dc2626;
}

#add-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-light);
    border: 2px dashed var(--border-soft);
    border-radius: var(--radius-lg);
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

#add-row:hover {
    background: var(--primary-soft);
    border-style: solid;
    border-color: var(--primary);
}

/* Shipping/Billing Partials Modern */
.modern-partial-section {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    margin-top: 1.5rem;
}

.modern-partial-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modern-partial-title i {
    color: var(--primary);
}

@media (max-width: 768px) {

    .product-grid-modern,
    .product-grid-secondary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .offer-card {
        padding: 2.5rem 1.5rem;
    }
}