/**
 * WA OTP Login - Frontend Styles
 * Clean, modern, and responsive design
 */

/* Container */
.wa-otp-container {
    max-width: 450px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Title */
.wa-otp-title {
    text-align: center;
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Steps */
.wa-otp-step {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Field Group */
.wa-otp-field-group {
    margin-bottom: 20px;
}

.wa-otp-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* Select */
.wa-otp-select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23666' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.wa-otp-select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* Phone Input Container */
.wa-otp-phone-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-otp-country-code {
    padding: 12px 15px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #666;
    min-width: 70px;
    text-align: center;
}

/* Input */
.wa-otp-input {
    flex: 1;
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
}

.wa-otp-input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wa-otp-input::placeholder {
    color: #999;
}

/* Code Input */
.wa-otp-code-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    padding: 15px;
}

/* Hint */
.wa-otp-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

/* Info Text */
.wa-otp-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Button */
.wa-otp-button {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #128C7E;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.wa-otp-button:hover {
    background: #0d7a6e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.3);
}

.wa-otp-button:active {
    transform: translateY(0);
}

.wa-otp-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.wa-otp-button-primary {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.wa-otp-button-primary:hover {
    background: linear-gradient(135deg, #20ba5a 0%, #0d7a6e 100%);
}

/* Button Loading State */
.wa-otp-btn-loading {
    display: inline-block;
}

.wa-otp-btn-loading:after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Actions */
.wa-otp-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Link Button */
.wa-otp-link-button {
    background: none;
    border: none;
    color: #128C7E;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
    transition: all 0.2s ease;
}

.wa-otp-link-button:hover {
    color: #0d7a6e;
}

/* Message */
.wa-otp-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wa-otp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wa-otp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wa-otp-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Notice */
.wa-otp-notice {
    padding: 15px;
    background: #f0f0f0;
    border-left: 4px solid #128C7E;
    border-radius: 4px;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .wa-otp-container {
        margin: 10px;
        padding: 30px 10px;
    }
    
    .wa-otp-title {
        font-size: 20px;
    }
    
    .wa-otp-actions {
        flex-direction: column;
        gap: 10px;
    }
    #customer_login {
        padding: 30px 15px !important;
    }
}

/* RTL Support */
[dir="rtl"] .wa-otp-select {
    background-position: left 15px center;
    padding-left: 40px;
    padding-right: 15px;
}

[dir="rtl"] .wa-otp-phone-input {
    flex-direction: row-reverse;
}

/* Enhanced error messages */
.wa-otp-message.error a {
    color: #25D366 !important;
    font-weight: bold;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.wa-otp-message.error a:hover {
    color: #128C7E !important;
    text-decoration: none;
}

.wa-otp-message strong {
    display: block;
    margin-bottom: 5px;
}

.wa-otp-message br + br {
    display: block;
    content: "";
    margin-top: 8px;
}

#customer_login {
    margin: 0 auto !important;
}