/**
 * Modal Styles
 * Vanilla modal dialogs for OTP verification and alerts
 */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.modal[style*="display: none"] {
    display: none !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    animation: slideUp 0.25s ease;
    display: flex;
    flex-direction: column;
    font-family: "Instrument Sans", sans-serif;
}

.modal-dialog-sm {
    max-width: 380px;
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #aaaaaa;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition:
        background 0.15s ease,
        color 0.15s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.modal-body {
    padding: 20px 28px 24px;
    flex: 1;
    overflow-y: auto;
}

.modal-body p {
    font-size: 14px;
    color: #555555;
    line-height: 1.65;
    margin: 0;
}

.modal-footer {
    padding: 16px 28px 24px;
    border-top: none;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.modal-footer .btn {
    flex: 1;
    min-width: 100px;
    height: 42px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
}

/* OTP Shadcn-style individual boxes */
.otp-inputs-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 16px;
}

.otp-box {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    font-family: "Instrument Sans", sans-serif;
    color: #1a1a1a;
    background: #fafafa;
    border: 1.5px solid #d4d4d8;
    border-radius: 8px;
    caret-color: transparent;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.otp-box:focus {
    outline: none;
    border-color: #1447e6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(20, 71, 230, 0.1);
}

.otp-box.otp-box--filled {
    border-color: #1a1a1a;
    background: #ffffff;
}

.otp-separator {
    font-size: 18px;
    color: #aaaaaa;
    padding: 0 2px;
    user-select: none;
    line-height: 1;
}

.otp-subtext {
    text-align: center;
    font-size: 14px;
    color: #666666;
    margin: 0 0 4px;
    line-height: 1.5;
}

.otp-timer {
    text-align: center;
    font-size: 13px;
    color: #888888;
    margin: 4px 0 16px;
}

.otp-timer span {
    font-weight: 600;
    color: #1447e6;
}

.resend-section {
    text-align: center;
    font-size: 13px;
    color: #888888;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.resend-btn {
    background: none;
    border: none;
    color: #1447e6;
    font-size: 13px;
    font-weight: 600;
    font-family: "Instrument Sans", sans-serif;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.15s ease;
}

.resend-btn:hover:not(:disabled) {
    color: #0d2ba3;
    text-decoration: underline;
}

.resend-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.resend-timer {
    font-size: 13px;
    color: #aaaaaa;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/**
 * Toast Notification Styles
 */

#toastContainer {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #2b2b2b;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #2b2b2b;
}

.toast.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast.toast-error {
    border-left: 4px solid var(--color-error);
}

.toast.toast-info {
    border-left: 4px solid #2196f3;
}

.toast.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}
