/* Modals CSS - Clean Extraction mapped to Tailwind Home Design System */
:root {
  --primary: #0151a3;
  --primary-dark: #023d7a;
  --dark: #1a1a1a;
  --green: #3d9130;
  --transition: all 0.25s ease;
  --radius: 8px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--dark);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.35s ease;
    white-space: nowrap;
}

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

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 40px 40px 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: #f5f5f5;
    color: var(--dark);
}

.modal-back {
    background: none;
    border: none;
    font-size: 15px;
    color: #555;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.modal-back:hover {
    color: var(--primary);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-bottom: 28px;
}

/* Phone Input */
.phone-input-wrap {
    margin-bottom: 20px;
}

.phone-field {
    position: relative;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    padding: 14px 14px 10px;
    transition: border-color 0.2s ease;
    cursor: text;
}

.phone-field:focus-within {
    border-color: var(--primary);
}

.phone-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.phone-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phone-prefix {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    flex-shrink: 0;
    padding-right: 10px;
    border-right: 1.5px solid #ddd;
}

.phone-input-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    background: transparent;
    font-family: 'Open Sans', sans-serif;
    letter-spacing: 1px;
}

/* OTP Button */
.otp-btn {
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
    background: #ccc;
    color: #fff;
    letter-spacing: 0.3px;
}

.otp-btn:not(:disabled) {
    background: var(--primary);
    cursor: pointer;
}

.otp-btn:not(:disabled):hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 70, 131, 0.35);
}

.otp-btn:disabled {
    cursor: not-allowed;
}

/* OTP Boxes */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-box {
    width: 48px;
    height: 52px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s ease;
    font-family: 'Open Sans', sans-serif;
}

.otp-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 70, 131, 0.1);
}

.otp-box.filled {
    border-color: var(--primary);
    background: #f0faf0;
}

/* Terms */
.modal-terms {
    font-size: 11.5px;
    color: #999;
    text-align: center;
    line-height: 1.7;
}

.modal-terms a {
    color: var(--dark);
    font-weight: 700;
    text-decoration: underline;
}

.modal-terms a:hover {
    color: var(--primary);
}

/* Resend */
.modal-resend {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-bottom: 16px;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

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

/* Success Step */
.success-icon {
    text-align: center;
    font-size: 56px;
    color: var(--green);
    margin-bottom: 16px;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Step visibility */
.modal-step {
    display: block;
}

.modal-step.hidden {
    display: none;
}
