/* Modern CSS Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Container */
.anysms-form-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Form Card */
.anysms-form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Form Header */
.anysms-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.anysms-form-header h2 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.anysms-form-header p {
    color: #718096;
    font-size: 16px;
    line-height: 1.5;
}

/* Login Tabs */
.anysms-login-tabs {
    display: flex;
    background: #f7fafc;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.anysms-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #718096;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.anysms-tab-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.anysms-tab-btn:hover:before {
    left: 100%;
}

.anysms-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.anysms-tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Tab Content */
.anysms-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.anysms-tab-content.active {
    display: block;
}

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

/* Form Styles */
.anysms-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.anysms-form-group {
    position: relative;
}

.anysms-form-group label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.025em;
}

.anysms-form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #2d3748;
    outline: none;
}

.anysms-form-group input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.anysms-form-group input:readonly {
    background: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

.anysms-form-group input::placeholder {
    color: #a0aec0;
}

/* Checkbox Styles */
.anysms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.anysms-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #667eea;
}

.anysms-checkbox-text {
    user-select: none;
}

/* Form Links */
.anysms-form-links {
    text-align: center;
    margin-top: 15px;
}

.anysms-forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.anysms-forgot-password:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Buttons */
.anysms-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.anysms-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.anysms-btn:hover:before {
    left: 100%;
}

.anysms-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.anysms-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.anysms-btn-primary:active {
    transform: translateY(0);
}

.anysms-btn-secondary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
    margin-top: 10px;
    font-size: 14px;
    padding: 12px 20px;
}

.anysms-btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.anysms-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* OTP Group */
.anysms-otp-group {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
    animation: fadeInDown 0.5s ease-out;
}

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

.anysms-otp-group input {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.2em;
    background: white;
}

/* OTP Actions */
.anysms-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.anysms-resend-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.anysms-countdown {
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    text-align: center;
    min-width: 200px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.anysms-countdown:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.anysms-countdown-pulse {
    animation: countdownPulse 0.3s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(1);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    }
    50% {
        transform: scale(1.05);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    100% {
        transform: scale(1);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    }
}

.anysms-resend-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
    position: relative;
    overflow: hidden;
}

.anysms-resend-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.anysms-resend-btn:hover:before {
    left: 100%;
}

.anysms-resend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

.anysms-resend-btn:active {
    transform: translateY(0);
}

/* Messages */
.anysms-message {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

.anysms-message-content {
    padding: 16px 20px;
    font-weight: 500;
    font-size: 14px;
}

.anysms-message.success .anysms-message-content {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2f855a;
    border-left: 4px solid #48bb78;
}

.anysms-message.error .anysms-message-content {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border-left: 4px solid #f56565;
}

.anysms-message.warning .anysms-message-content {
    background: linear-gradient(135deg, #feebc8 0%, #fbd38d 100%);
    color: #c05621;
    border-left: 4px solid #ed8936;
}

/* Form Footer */
.anysms-form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.anysms-form-footer p {
    color: #718096;
    font-size: 14px;
}

.anysms-form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.anysms-form-footer a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Spinner Animation */
.anysms-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* WooCommerce Checkout Styles */
.anysms-checkout-verification {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.anysms-checkout-verification h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.anysms-checkout-phone-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.anysms-checkout-phone-section .form-row {
    margin-bottom: 0;
}

.anysms-checkout-phone-section input[type="tel"],
.anysms-checkout-phone-section input[type="text"] {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.anysms-checkout-phone-section input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.anysms-checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.anysms-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.anysms-checkout-btn.verified {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.anysms-checkout-otp-section {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #cbd5e0;
    animation: fadeInDown 0.5s ease-out;
}

.anysms-checkout-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.anysms-checkout-resend-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.anysms-checkout-countdown {
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    padding: 10px 16px;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    text-align: center;
    min-width: 180px;
}

.anysms-checkout-resend-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

.anysms-checkout-resend-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

.anysms-checkout-status {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.anysms-checkout-status.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2f855a;
    border-left: 4px solid #48bb78;
}

.anysms-checkout-status.error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border-left: 4px solid #f56565;
}

.anysms-checkout-status p {
    padding: 12px 16px;
    margin: 0;
    font-weight: 500;
    font-size: 14px;
}

#phone-verification-status .verified {
    color: #38a169;
    font-weight: 600;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .anysms-form-container {
        padding: 15px;
        min-height: 100vh;
    }
    
    .anysms-form-card {
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .anysms-form-header h2 {
        font-size: 24px;
    }
    
    .anysms-login-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .anysms-tab-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .anysms-form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .anysms-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .anysms-btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .anysms-otp-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .anysms-resend-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .anysms-countdown {
        min-width: auto;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .anysms-checkout-verification {
        padding: 20px 15px;
    }
    
    .anysms-checkout-resend-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .anysms-checkout-countdown {
        min-width: auto;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .anysms-form-card {
        padding: 25px 20px;
    }
    
    .anysms-form-header h2 {
        font-size: 22px;
    }
    
    .anysms-form-header p {
        font-size: 14px;
    }
    
    .anysms-login-tabs {
        margin-bottom: 20px;
    }
    
    .anysms-tab-btn {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .anysms-countdown {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .anysms-checkout-verification {
        padding: 15px 10px;
    }
}

/* Accessibility Improvements */
.anysms-btn:focus,
.anysms-form-group input:focus,
.anysms-tab-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .anysms-form-card {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .anysms-form-group input {
        border: 2px solid #000000;
    }
    
    .anysms-btn-primary {
        background: #000000;
        border: 2px solid #000000;
    }
    
    .anysms-tab-btn.active {
        background: #000000;
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .anysms-countdown-pulse {
        animation: none !important;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}