/* Login Modal Styles - Bold Duotone */

.modal-content {
    border: none;
    border-radius: 1.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px color-mix(in srgb, var(--primary) 35%, transparent), 0 10px 10px -5px rgb(0 0 0 / 0.08);
}

.modal-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--gradient);
    color: white;
    padding: 2rem 1.5rem 0;
}

.modal-header::before,
.modal-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: .55;
    z-index: 0;
    pointer-events: none;
}

.modal-header::before {
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, .35);
    top: -60px;
    left: -40px;
}

.modal-header::after {
    width: 200px;
    height: 200px;
    background: color-mix(in srgb, var(--secondary) 60%, white);
    bottom: -90px;
    right: -60px;
}

.modal-header > div:first-child {
    position: relative;
    z-index: 1;
    margin-bottom: 1.1rem;
    padding: 0 2.75rem;
}

.modal-header-icon {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 1.15rem;
    color: white;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.modal-header .modal-title {
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}

.modal-header .modal-title > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: 0.6rem !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 1.15rem;
    vertical-align: middle;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.modal-header .text-muted {
    color: rgba(255, 255, 255, 0.85) !important;
}

.modal-header .btn-close {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    z-index: 2;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.18) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.027 1.027-.235 6.738 6.738 6.738-6.738 1.027.235-6.738 6.738 6.738 6.738-1.027.235L8 8.265l-6.738 6.738-1.027-.235L6.973 8 .235 1.262z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    opacity: 0.9;
    filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.32) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.027 1.027-.235 6.738 6.738 6.738-6.738 1.027.235-6.738 6.738 6.738 6.738-1.027.235L8 8.265l-6.738 6.738-1.027-.235L6.973 8 .235 1.262z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1) rotate(90deg);
}

.modal-body {
    position: relative;
    z-index: 1;
    background: white;
    padding: 1.1rem 2rem 2.25rem;
    margin-top: -1.1rem;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -14px 24px -20px rgba(0, 0, 0, 0.3);
}

/* Login Tabs */
.nav-pills {
    background: color-mix(in srgb, var(--light) 100%, transparent);
    border: 1px solid var(--border);
    padding: 0.3rem;
    border-radius: 999px;
}

.nav-pills .nav-link {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-weight: 600;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
    padding: 0.65rem 1rem;
    transition: all 0.3s ease;
    border-radius: 999px !important;
    margin: 0 2px;
}

.nav-pills .nav-link:hover {
    color: var(--primary);
}

.nav-pills .nav-link.active {
    background: var(--gradient);
    color: white;
    box-shadow: 0 8px 16px -6px color-mix(in srgb, var(--primary) 55%, transparent);
}

/* From theme login-modal partials (famms/ashion/aura) — active tab text/icon color */
.modal-body .nav-link.active, .modal-body .nav-link.active i {
    color: #ffffff !important;
}

/* Form Styles */
.form-label {
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0.82rem 1rem;
    font-size: 1rem;
    background: color-mix(in srgb, var(--light) 92%, white);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

.input-group-text {
    background: color-mix(in srgb, var(--light) 92%, white);
    border: 1.5px solid var(--border);
    border-right: none;
    color: var(--secondary);
    font-weight: 500;
    border-radius: 12px 0 0 12px;
}

.input-group .form-control {
    /* border-left: none; */
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, white);
    color: var(--primary);
}

.input-group:focus-within .form-control {
    border-color: var(--primary);
    background: white;
}

/* Button Styles */
.btn-gradient {
    background: var(--gradient);
    border: none;
    border-radius: 999px;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--primary) 55%, transparent);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -8px color-mix(in srgb, var(--primary) 65%, transparent);
    color: white;
}

.btn-google,
.btn-facebook,
.btn-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
}

.social-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-facebook .social-icon-badge {
    background: #1877F2;
}

.btn-instagram .social-icon-badge {
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
}

.btn-google {
    background: color-mix(in srgb, #db4437 10%, white);
    border: 1.5px solid color-mix(in srgb, #db4437 35%, white);
    color: #db4437;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #db4437;
    color: white;
    border-color: #db4437;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -6px rgba(219, 68, 55, 0.45);
}

/* Toggle Password Button */
.btn-outline-secondary {
    border-color: var(--border);
    color: var(--secondary);
    /* border-left: none; */
}

.btn-outline-secondary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Form Check */
.form-check-input {
    border: 2px solid var(--border);
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--dark);
    font-weight: 500;
}

/* Divider */
.divider {
    position: relative;
    text-align: center;
}

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

.divider-text {
    background: white;
    padding: 0 1rem;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}

/* Terms / trust microcopy under the OTP CTA */
.modal-terms {
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--secondary);
    margin: -0.5rem 0 0.5rem;
}

.modal-terms a {
    font-weight: 600;
}

/* Country Code Select in Login Modal */
.input-group > .form-select,
#loginModal .form-select {
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: 12px 0 0 12px;
    background: color-mix(in srgb, var(--light) 92%, white);
    color: var(--dark);
    font-weight: 500;
}

.input-group > .form-select:focus,
#loginModal .form-select:focus {
    border-color: var(--primary);
    box-shadow: none;
}

/* OTP Section */
#otpSection.show,
#emailOtpSection.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP step icon badge */
#otpSection .text-center > i.fa-mobile-alt,
#emailOtpSection .text-center > i.fa-envelope-open {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, white);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, white);
    box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--primary) 45%, transparent);
    font-size: 1.75rem !important;
    color: var(--primary);
    opacity: 1;
}

/* OTP Input Boxes */
.otp-input-container {
    max-width: 320px;
    margin: 0 auto;
}

.otp-digit,
.mobile-otp-digit {
    width: 48px;
    height: 54px;
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
    background: color-mix(in srgb, var(--light) 92%, white);
}

.otp-digit:focus,
.mobile-otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
    outline: none;
    background: white;
}

.otp-digit.filled,
.mobile-otp-digit.filled {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 8%, white);
    color: var(--success);
}

.otp-digit.error,
.mobile-otp-digit.error {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, white);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* OTP Section Icons */
.fa-envelope-open,
.fa-mobile-alt {
    color: var(--primary);
    opacity: 0.8;
}

/* Hide/Show Sections */
.section-hidden {
    display: none !important;
}

.section-visible {
    display: block !important;
}

/* Links */
.btn-link {
    color: var(--primary);
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success State */
.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.valid-feedback {
    color: var(--success);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 1rem;
    }

    .modal-content {
        border-radius: 1.25rem;
    }

    .modal-body {
        padding: 1rem 1.5rem 1.75rem;
        margin-top: -0.9rem;
        border-radius: 1.25rem 1.25rem 0 0;
    }

    .modal-header {
        padding: 1.5rem 1.25rem 0;
    }

    .modal-header > div:first-child {
        margin-bottom: 1rem;
    }

    .nav-pills .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .otp-digit,
    .mobile-otp-digit {
        width: 40px;
        height: 46px;
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.65rem 1rem;
    }
}

.btn-facebook {
    background: color-mix(in srgb, #1877F2 10%, white);
    border: 1.5px solid color-mix(in srgb, #1877F2 35%, white);
    color: #1877F2;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-facebook:hover {
    background: #1877F2;
    color: white;
    border-color: #1877F2;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -6px rgba(24, 119, 242, 0.45);
}

.btn-instagram {
    background: color-mix(in srgb, #d6249f 10%, white);
    border: 1.5px solid color-mix(in srgb, #d6249f 35%, white);
    color: #d6249f;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-instagram:hover {
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -6px rgba(214, 36, 159, 0.45);
}
