/**
 * WooCommerce Phone OTP Login - Styles
 */

/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --background-light: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
.wc-phone-otp-login * {
    box-sizing: border-box;
}

.wc-phone-otp-login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.wc-phone-otp-login::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.wc-phone-otp-login::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Container Layout */
.wc-phone-otp-login > * {
    position: relative;
    z-index: 10;
}

.phone-otp-card {
    background: var(--background);
    border-radius: 24px;
    box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.phone-otp-header {
    text-align: center;
    margin-bottom: 32px;
}

.phone-otp-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.phone-otp-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* Form */
.phone-otp-form {
    position: relative;
}

.form-step {
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: var(--transition);
    pointer-events: none;
}

.form-step.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Form Group */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
    background: var(--background-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.help-text {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Phone Input */
.phone-input {
    font-size: 16px !important;
}

/* OTP Input Container */
.otp-input-wrapper {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

#otp-input {
    letter-spacing: 8px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.otp-digit {
    width: 50px;
    height: 56px;
    padding: 0;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-light);
    transition: var(--transition);
}

.otp-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Verify Text */
.verify-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

/* Error Message */
.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 8px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP Timer */
.otp-timer {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
}

.otp-timer span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

/* Button Loader */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Text Button */
.btn-link,
.btn-text-link {
    background: none;
    color: var(--primary-color);
    padding: 0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-link:hover:not(:disabled),
.btn-text-link:hover {
    color: var(--primary-dark);
}

.btn-link:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--primary-dark);
}

/* OTP Footer */
.otp-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.otp-footer p {
    margin: 0 0 8px 0;
}

#back-btn {
    margin-top: 24px;
    display: block;
    color: var(--primary-color);
}

/* Success Content */
.success-content {
    text-align: center;
    padding: 40px 0;
}

.success-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-content h3 {
    font-size: 22px;
    margin: 16px 0 8px 0;
    color: var(--success-color);
}

.success-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Features Section */
.phone-otp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.feature {
    text-align: center;
    padding: 24px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.feature h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: white;
}

.feature p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 480px) {
    .phone-otp-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .phone-otp-header h2 {
        font-size: 24px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .otp-digit {
        width: 44px;
        height: 48px;
        font-size: 20px;
    }

    .phone-otp-features {
        display: none;
    }

    .btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f3f4f6;
        --text-secondary: #d1d5db;
        --background: #1f2937;
        --background-light: #111827;
        --border-color: #374151;
    }

    .wc-phone-otp-login {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }

    .phone-otp-card {
        background: #1f2937;
    }
}

/* Print Styles */
@media print {
    .wc-phone-otp-login {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}