/**
 * Frontend Auth Modal Styles (Matching Custom Orange Design)
 */

.ers-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.ers-modal-dialog {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    margin: auto;
}

.ers-modal-login {
    max-width: 520px;
    padding: 36px 40px;
}

.ers-modal-signup {
    max-width: 680px;
    padding: 32px 36px;
    max-height: 90vh;
    overflow-y: auto;
}

.ers-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.ers-modal-close:hover {
    color: #1e293b;
}

.ers-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 24px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ers-auth-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
}

.ers-auth-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

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

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

.ers-auth-form label {
    display: block;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    margin-bottom: 6px;
}

.ers-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.ers-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ers-input-icon-wrap input,
.ers-auth-form select,
.ers-auth-form input[type="text"],
.ers-auth-form input[type="email"],
.ers-auth-form input[type="password"],
.ers-auth-form input[type="tel"],
.ers-auth-form input[type="date"] {
    width: 100%;
    height: 42px;
    padding: 8px 38px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ers-auth-form input:focus,
.ers-auth-form select:focus {
    outline: none;
    border-color: #e07a2d;
    box-shadow: 0 0 0 3px rgba(224, 122, 45, 0.15);
}

.ers-input-icon {
    position: absolute;
    right: 12px;
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Upload Buttons */
.ers-btn-file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border: 1px solid #e07a2d;
    border-radius: 20px;
    color: #e07a2d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.ers-btn-file-upload:hover {
    background: #fff8f3;
}

.ers-btn-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ers-btn-file-upload.has-file {
    background: #e7f7e9;
    border-color: #2da650;
    color: #2da650;
}

.ers-btn-file-upload.has-file svg {
    stroke: #2da650;
}

/* Checkboxes */
.ers-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 4px;
}

.ers-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Footer & Buttons */
.ers-form-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    gap: 16px;
}

.ers-btn-auth-submit {
    background: #e07a2d;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.ers-btn-auth-submit:hover {
    background: #c8651c;
}

.ers-btn-auth-submit:disabled {
    background: #fbd6b8;
    cursor: not-allowed;
}

.ers-form-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.ers-link-orange {
    color: #e07a2d;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.ers-link-orange:hover {
    text-decoration: underline;
}

.ers-divider {
    color: #cbd5e1;
}

.ers-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
}

.ers-form-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.ers-btn-signup-submit {
    min-width: 140px;
}

.ers-signup-footer-link {
    font-size: 14px;
    color: #64748b;
}

.ers-signup-footer-link a {
    margin-left: 6px;
}

/* Logged-In Bar */
.ers-auth-logged-in-box {
    padding: 12px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.ers-btn-auth {
    display: inline-block;
    padding: 6px 14px;
    background: #e07a2d;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-left: 8px;
    font-size: 13px;
}

/* Inline Auth Container */
.ers-inline-auth-container {
    max-width: 720px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ers-auth-tabs {
    display: flex;
    border-bottom: 2px solid #f1f5f9;
    background: #f8fafc;
}

.ers-auth-tab-btn {
    flex: 1;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.ers-auth-tab-btn.active {
    color: #e07a2d;
    background: #ffffff;
    border-bottom: 2px solid #e07a2d;
    margin-bottom: -2px;
}

.ers-auth-card {
    padding: 32px 36px;
}

.ers-btn-auth.ers-btn-outline {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* OTP Verification Step */
.ers-otp-verification-container {
    animation: ersFadeIn 0.3s ease;
}

@keyframes ersFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ers-otp-verification-container input[type="text"]#ers-modal-otp-code,
.ers-otp-verification-container input[type="text"]#ers-inline-otp-code {
    letter-spacing: 8px !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    border: 2px solid #cbd5e1 !important;
    transition: all 0.2s ease;
}

.ers-otp-verification-container input[type="text"]#ers-modal-otp-code:focus,
.ers-otp-verification-container input[type="text"]#ers-inline-otp-code:focus {
    border-color: #e07a2d !important;
    box-shadow: 0 0 0 3px rgba(224, 122, 45, 0.2) !important;
    background: #fffbf8 !important;
}
