/* ========================================
   OTP LOGIN MODAL STYLES
   ======================================== */

/* Modal Overlay */
.otp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.otp-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.otp-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    padding: 48px 40px;
    position: relative;
    box-shadow: 0 20px 60px rgba(1, 74, 150, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.otp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f6f8;
    border-radius: 50%;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.otp-modal-close:hover {
    background: #e74c3c;
    color: white;
    transform: rotate(90deg);
}

/* Modal Header */
.otp-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.otp-icon {
    width: 64px;
    height: 64px;
    stroke: #014A96;
    stroke-width: 2;
    margin: 0 auto 20px;
    display: block;
}

.otp-icon.success {
    stroke: #27ae60;
    stroke-width: 2.5;
}

.otp-modal-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.otp-modal-header p {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.5;
}

.otp-modal-header strong {
    color: #014A96;
    font-weight: 700;
}

.otp-change-email {
    background: none;
    border: none;
    color: #014A96;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
}

.otp-change-email:hover {
    text-decoration: underline;
}

/* Steps */
.otp-step {
    display: none;
}

.otp-step.active {
    display: block;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form Groups */
.otp-form-group {
    margin-bottom: 24px;
}

.otp-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

/* Input Fields */
.otp-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    color: #1a1a1a;
    transition: all 0.3s;
    background: #f8f9fa;
}

.otp-input:focus {
    outline: none;
    border-color: #014A96;
    background: white;
    box-shadow: 0 0 0 4px rgba(1, 74, 150, 0.1);
}

.otp-input::placeholder {
    color: #adb5bd;
}

/* OTP Digit Inputs */
.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.otp-digit {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    color: #014A96;
    background: #f8f9fa;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.otp-digit:focus {
    outline: none;
    border-color: #014A96;
    background: white;
    box-shadow: 0 0 0 4px rgba(1, 74, 150, 0.15);
    transform: scale(1.05);
}

.otp-digit:not(:placeholder-shown) {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
    border-color: #014A96;
}

/* Buttons */
.otp-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.otp-btn-primary {
    background: linear-gradient(135deg, #014A96 0%, #0263C7 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(1, 74, 150, 0.3);
}

.otp-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #013566 0%, #014A96 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 74, 150, 0.4);
}

.otp-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.otp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.otp-btn .btn-text {
    display: inline-block;
}

.otp-btn .btn-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.otp-btn.loading .btn-text {
    display: none;
}

.otp-btn.loading .btn-loader {
    display: flex;
}

/* Spinner Animation */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Link Button */
.otp-btn-link {
    background: none;
    border: none;
    color: #014A96;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 0;
    transition: all 0.3s;
}

.otp-btn-link:hover {
    color: #013566;
    text-decoration: underline;
}

/* Error Messages */
.otp-error {
    background: #ffebee;
    border-left: 4px solid #e74c3c;
    padding: 14px 16px;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Success Message */
.otp-success {
    background: #e8f5e9;
    border-left: 4px solid #27ae60;
    padding: 14px 16px;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Security Notice */
.otp-security-notice {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    color: #014A96;
    font-weight: 600;
    text-align: center;
    margin-top: 24px;
}

/* Resend Section */
.otp-resend-section {
    text-align: center;
    margin-top: 24px;
}

.otp-timer {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.otp-timer span {
    font-weight: 700;
    color: #014A96;
}

/* User Account Menu (Navbar) */
.user-account-menu {
    position: relative;
}

.user-account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
    border: 2px solid #014A96;
    border-radius: 25px;
    color: #014A96;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.user-account-btn:hover {
    background: #014A96;
    color: white;
}

.user-account-btn svg {
    stroke: currentColor;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 260px;
    overflow: hidden;
    animation: dropdownSlide 0.3s ease;
    z-index: 1000;
}

.account-dropdown.active {
    display: block;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, #014A96 0%, #0263C7 100%);
    color: white;
}

.dropdown-header strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.dropdown-header small {
    font-size: 13px;
    opacity: 0.9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #1a1a1a;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #014A96;
}

.dropdown-item svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.logout-btn {
    border-top: 1px solid #e0e0e0;
    color: #e74c3c;
}

.logout-btn:hover {
    background: #ffebee;
}

/* Responsive Design */
@media (max-width: 600px) {
    .otp-modal-content {
        padding: 32px 24px;
        border-radius: 20px;
        margin: 0 15px;
    }
    
    .otp-modal-header h2 {
        font-size: 24px;
    }
    
    .otp-modal-header p {
        font-size: 14px;
    }
    
    .otp-icon {
        width: 48px;
        height: 48px;
    }
    
    .otp-inputs {
        gap: 8px;
    }
    
    .otp-digit {
        font-size: 24px;
        border-width: 2px;
    }
    
    .account-dropdown {
        right: -20px;
        min-width: 240px;
    }
}

@media (max-width: 400px) {
    .otp-modal-content {
        padding: 24px 16px;
    }
    
    .otp-inputs {
        gap: 6px;
    }
    
    .otp-digit {
        font-size: 20px;
    }
}

/* Toast Notification for Login Success */
.otp-toast {
    position: fixed;
    top: 100px;
    right: 30px;
    background: white;
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.otp-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.otp-toast.success {
    border-left: 4px solid #27ae60;
}

.otp-toast.error {
    border-left: 4px solid #e74c3c;
}

.otp-toast-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.otp-toast.success .otp-toast-icon {
    background: #27ae60;
    color: white;
}

.otp-toast.error .otp-toast-icon {
    background: #e74c3c;
    color: white;
}

.otp-toast-message {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 15px;
}
