/**
 * Phone OTP Login & Register Plugin CSS
 * Complete styling for the login/register form
 */

/* ============================================
   Container Styles
   ============================================ */
.pol-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: rtl;
}

.pol-form-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
}

/* ============================================
   Header Styles with Animations
   ============================================ */
.pol-header {
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.pol-header h3 {
    font-size: 24px;
    color: #333;
    margin: 0 0 10px 0;
    transition: color 0.3s ease;
}

.pol-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
    transition: opacity 0.3s ease;
}

/* Header animation */
.pol-header-animate {
    animation: polHeaderFadeIn 0.3s ease;
}

@keyframes polHeaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step-specific header colors */
.pol-step-1-active .pol-header h3 {
    color: #007bff;
}

.pol-step-2-active .pol-header h3 {
    color: #28a745;
}

.pol-step-3-active .pol-header h3 {
    color: #ffc107;
}

/* ============================================
   Form Groups
   ============================================ */
.pol-form-group {
    margin-bottom: 20px;
}

.pol-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.pol-hint {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* ============================================
   Input Fields
   ============================================ */
.pol-input, .pol-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.pol-input:focus, .pol-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.pol-input.pol-readonly {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

/* ============================================
   Radio Button Styles
   ============================================ */
.pol-method-selector {
    margin-bottom: 20px;
}

.pol-method-selector > label {
    display: block;
    margin-bottom: 12px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.pol-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pol-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.pol-radio-label:hover {
    border-color: #007bff;
    background: #f0f7ff;
    transform: translateX(-2px);
}

.pol-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pol-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-left: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pol-radio:checked + .pol-radio-custom {
    border-color: #007bff;
    border-width: 2px;
}

.pol-radio:checked + .pol-radio-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #007bff;
    border-radius: 50%;
}

.pol-radio-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* ============================================
   Info Box
   ============================================ */
.pol-info-box {
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #1565c0;
}

/* ============================================
   Buttons
   ============================================ */
.pol-submit-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pol-submit-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.pol-submit-btn:active {
    transform: translateY(0);
}

.pol-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pol-resend-btn, .pol-back-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.pol-resend-btn:hover, .pol-back-btn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

.pol-resend-btn:disabled, .pol-back-btn:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.pol-back-btn {
    color: #6c757d;
    border-color: #6c757d;
}

.pol-back-btn:hover {
    background: #6c757d;
    color: white;
}

/* ============================================
   Messages
   ============================================ */
.pol-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: polMessageFadeIn 0.3s ease;
}

@keyframes polMessageFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pol-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pol-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   Error Messages
   ============================================ */
.pol-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.pol-error.show {
    display: block;
    animation: polErrorFadeIn 0.3s ease;
}

@keyframes polErrorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Loading Overlay
   ============================================ */
.pol-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    animation: polOverlayFadeIn 0.2s ease;
}

@keyframes polOverlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.pol-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: polSpin 1s linear infinite;
}

@keyframes polSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pol-loading-text {
    color: white;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   Logged-in User Message
   ============================================ */
.pol-logged-in-message {
    text-align: center;
    padding: 20px;
}

.pol-success-icon {
    width: 60px;
    height: 60px;
    background: #4caf50;
    color: white;
    font-size: 32px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: polSuccessIconPop 0.5s ease;
}

@keyframes polSuccessIconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pol-logged-in-message h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.pol-logged-in-message p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.pol-button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.pol-logout-btn, .pol-dashboard-btn {
    display: inline-block;
    padding: 10px 25px;
    margin: 5px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pol-logout-btn {
    background: #dc3545;
    color: white;
}

.pol-logout-btn:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.pol-dashboard-btn {
    background: #007bff;
    color: white;
}

.pol-dashboard-btn:hover {
    background: #0056b3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Redirect countdown */
.pol-redirect-countdown {
    margin-top: 15px;
    font-size: 12px;
    color: #999;
}

.pol-redirect-countdown span {
    font-weight: bold;
    color: #007bff;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .pol-form-wrapper {
        padding: 20px;
    }
    
    .pol-header h3 {
        font-size: 20px;
    }
    
    .pol-radio-label {
        padding: 8px;
    }
    
    .pol-button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .pol-logout-btn, .pol-dashboard-btn {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .pol-container {
        padding: 10px;
    }
    
    .pol-form-wrapper {
        padding: 15px;
    }
    
    .pol-header h3 {
        font-size: 18px;
    }
    
    .pol-submit-btn, .pol-resend-btn, .pol-back-btn {
        padding: 10px;
        font-size: 14px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.pol-input:focus-visible,
.pol-select:focus-visible,
.pol-submit-btn:focus-visible,
.pol-resend-btn:focus-visible,
.pol-back-btn:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .pol-container {
        display: none;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .pol-form-wrapper {
        background: #1e1e1e;
    }
    
    .pol-header h3 {
        color: #e0e0e0;
    }
    
    .pol-header p {
        color: #b0b0b0;
    }
    
    .pol-form-group label {
        color: #e0e0e0;
    }
    
    .pol-input, .pol-select {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .pol-input:focus, .pol-select:focus {
        border-color: #007bff;
    }
    
    .pol-radio-label {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .pol-radio-text {
        color: #e0e0e0;
    }
    
    .pol-logged-in-message h3 {
        color: #e0e0e0;
    }
    
    .pol-logged-in-message p {
        color: #b0b0b0;
    }
}

/* ============================================
   Toast Notifications (Modern Alerts)
   ============================================ */
.pol-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.pol-toast {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: polToastSlideIn 0.3s ease;
    border-right: 4px solid;
    direction: rtl;
}

@keyframes polToastSlideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pol-toast-success {
    border-right-color: #28a745;
}

.pol-toast-error {
    border-right-color: #dc3545;
}

.pol-toast-info {
    border-right-color: #17a2b8;
}

.pol-toast-warning {
    border-right-color: #ffc107;
}

.pol-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pol-toast-content {
    flex: 1;
}

.pol-toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.pol-toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.pol-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pol-toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ============================================
   Alert Box (Logged-in Message)
   ============================================ */
.pol-alert {
    border-radius: 12px;
    padding: 20px;
    margin: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: polAlertPulse 0.5s ease;
}

@keyframes polAlertPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pol-alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdef5 100%);
    border: 1px solid #90caf9;
}

.pol-alert-with-icon {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.pol-alert-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.pol-alert-content {
    flex: 1;
}

.pol-alert-content h4 {
    margin: 0 0 8px 0;
    color: #1565c0;
    font-size: 18px;
}

.pol-alert-content p {
    margin: 0 0 12px 0;
    color: #0d47a1;
}

.pol-alert-progress {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    height: 4px;
    margin: 12px 0;
    overflow: hidden;
}

.pol-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    border-radius: 10px;
    transition: width 1s linear;
    animation: polProgressShine 1s linear infinite;
}

@keyframes polProgressShine {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

.pol-redirect-text {
    font-size: 13px;
    color: #1565c0;
    margin-top: 8px;
}

/* ============================================
   Modern Loading Overlay
   ============================================ */
.pol-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    animation: polOverlayFadeIn 0.2s ease;
}

@keyframes polOverlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.pol-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #007bff;
    border-right: 4px solid #28a745;
    border-bottom: 4px solid #ffc107;
    border-left: 4px solid #dc3545;
    border-radius: 50%;
    animation: polSpin 0.8s linear infinite;
}

@keyframes polSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pol-loading-text {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    animation: polTextPulse 1.5s ease infinite;
}

@keyframes polTextPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   Error/Input Field Styles
   ============================================ */
.pol-input-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    animation: polShake 0.4s ease;
}

@keyframes polShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.pol-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    padding: 5px 10px;
    background: #ffe5e5;
    border-radius: 6px;
    border-right: 3px solid #dc3545;
}

.pol-error.show {
    display: block;
    animation: polErrorSlideDown 0.3s ease;
}

@keyframes polErrorSlideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Success Message Styles
   ============================================ */
.pol-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    animation: polSuccessSlideIn 0.3s ease;
    direction: rtl;
}

@keyframes polSuccessSlideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pol-success-message .pol-check-icon {
    font-size: 20px;
}

/* ============================================
   Responsive Alert Styles
   ============================================ */
@media (max-width: 768px) {
    .pol-toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
        bottom: 10px;
    }
    
    .pol-alert {
        margin: 10px;
        padding: 15px;
    }
    
    .pol-alert-icon {
        font-size: 36px;
    }
    
    .pol-alert-content h4 {
        font-size: 16px;
    }
    
    .pol-success-message {
        top: 10px;
        right: 10px;
        left: 10px;
        border-radius: 12px;
        text-align: center;
        justify-content: center;
    }
}