/**
 * Advance Password Recovery - Frontend Styles
 * 
 * @package Advance_Password_Recovery
 */

.apr-password-reset-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.apr-reset-wrapper {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.apr-title {
    text-align: center;
    margin: 0 0 32px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Tabs */
.apr-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.apr-tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.apr-tab-btn:hover {
    color: #374151;
}

.apr-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Tab Content */
.apr-tab-content {
    display: none;
}

.apr-tab-content.active {
    display: block;
}

/* Firebase reCAPTCHA container - invisible but must exist for Phone Auth */
.apr-recaptcha-container {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Form Groups */
.apr-form-group {
    margin-bottom: 20px;
}

.apr-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.apr-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.apr-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Password field with show/hide toggle */
.apr-password-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}
.apr-password-wrap .apr-input {
    padding-right: 48px;
    flex: 1;
}
.apr-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #6b7280;
    border-radius: 0 8px 8px 0;
    transition: color 0.2s ease, background 0.2s ease;
    padding: 0;
}
.apr-password-toggle:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06) !important;
}
.apr-password-toggle:focus {
    outline: none;
    color: #2563eb;
}
.apr-password-toggle .apr-icon-svg {
    display: block;
    flex-shrink: 0;
    fill: none !important;
    stroke: currentColor;
    color: inherit;
}
.apr-password-wrap .apr-icon-svg {
    width: 22px;
    height: 22px;
}
.apr-icon-svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
}

/* Phone Input Wrapper */
.apr-phone-input-wrapper {
    display: flex;
    gap: 8px;
}

.apr-country-code {
    width: 140px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apr-country-code:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.apr-phone-input {
    flex: 1;
}

/* OTP Container - 6 Digit Boxes */
.apr-otp-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.apr-otp-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.apr-otp-box:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.apr-otp-box:not(:placeholder-shown) {
    border-color: #2563eb;
}

.apr-otp-hint {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

/* Buttons */
.apr-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.apr-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.apr-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.apr-btn-primary:active {
    transform: translateY(0);
}

/* Resend OTP: timer and button */
.apr-resend-wrap {
    text-align: center;
    margin: 12px 0 16px 0;
    min-height: 40px;
}

.apr-resend-timer {
    font-size: 14px;
    color: #6b7280;
}

.apr-btn-resend {
    width: auto;
    padding: 8px 16px;
    margin: 0;
    background: transparent;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #2563eb;
    border-radius: 6px;
}

.apr-btn-resend:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border-color: #1d4ed8;
    transform: none;
    box-shadow: none;
}

.apr-btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.apr-btn-danger {
    background: #dc2626;
}

.apr-btn-danger:hover {
    background: #b91c1c;
}

.apr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Messages */
.apr-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

/* Warning Box */
.apr-warning-box {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.apr-warning-box strong {
    color: #92400e;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.apr-warning-box p {
    color: #78350f;
    margin: 0 0 8px 0;
    font-size: 13px;
}

.apr-warning-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    color: #78350f;
    font-size: 13px;
}

.apr-warning-box ul li {
    margin-bottom: 4px;
}

/* Success Box */
.apr-success-box {
    text-align: center;
    padding: 32px 20px;
}

.apr-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 32px;
    line-height: 64px;
    margin: 0 auto 20px;
    font-weight: bold;
}

.apr-success-box h3 {
    color: #059669;
    font-size: 20px;
    margin: 0 0 12px 0;
}

.apr-success-box p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

/* Loading Overlay */
.apr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.apr-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.apr-loading-text {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

/* Steps: smooth transitions */
.apr-step {
    animation: aprFadeIn 0.35s ease;
}
.apr-tab-content {
    animation: aprFadeIn 0.3s ease;
}

@keyframes aprFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button transitions */
.apr-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.apr-btn:disabled {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    .apr-password-reset-container {
        margin: 20px;
        padding: 10px;
    }
    
    .apr-reset-wrapper {
        padding: 24px;
    }
    
    .apr-title {
        font-size: 20px;
    }
    
    .apr-tab-btn {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .apr-otp-box {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
    
    .apr-phone-input-wrapper {
        flex-direction: column;
    }
    
    .apr-country-code {
        width: 100%;
    }
}
