/**
 * EXEC OTP Verification - Frontend Styles
 * 
 * Styles for OTP verification forms on public-facing pages.
 * Uses EXEC Security brand colours.
 * 
 * @package EXEC_OTP_Verification
 * @since 2.0.0
 */

/* CSS Variables */
:root {
    --exec-deep-blue: #0B0E1F;
    --exec-bright-orange: #FA4F36;
    --exec-orange-hover: #ff6a52;
    --exec-white: #FFFFFF;
    --exec-light-grey: #f8f9fa;
    --exec-text-muted: #6c757d;
    --exec-border-color: #dee2e6;
    --exec-success: #28a745;
    --exec-error: #dc3545;
    --exec-warning: #ffc107;
    --exec-shadow: 0 2px 8px rgba(11, 14, 31, 0.1);
    --exec-transition: all 0.3s ease;
}

/* OTP Form Container */
.exec-otp-container {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 420px;
    margin: 2rem auto;
    padding: 0;
    box-sizing: border-box;
}

.exec-otp-container * {
    box-sizing: border-box;
}

/* OTP Form Card */
.exec-otp-form {
    background: var(--exec-white);
    border-radius: 8px;
    box-shadow: var(--exec-shadow);
    overflow: hidden;
}

/* Form Header */
.exec-otp-header {
    background: var(--exec-deep-blue);
    padding: 1.5rem;
    text-align: center;
}

.exec-otp-header h3 {
    color: var(--exec-white);
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.exec-otp-header p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.875rem;
}

.exec-otp-header .exec-icon {
    width: 48px;
    height: 48px;
    background: var(--exec-bright-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.exec-otp-header .exec-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--exec-white);
}

/* Form Body */
.exec-otp-body {
    padding: 1.5rem;
}

/* Form Groups */
.exec-otp-form-group {
    margin-bottom: 1.25rem;
}

.exec-otp-form-group:last-child {
    margin-bottom: 0;
}

.exec-otp-label {
    display: block;
    color: var(--exec-deep-blue);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Input Fields */
.exec-otp-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--exec-deep-blue);
    background: var(--exec-light-grey);
    border: 2px solid var(--exec-border-color);
    border-radius: 6px;
    transition: var(--exec-transition);
}

.exec-otp-input:focus {
    outline: none;
    border-color: var(--exec-bright-orange);
    background: var(--exec-white);
    box-shadow: 0 0 0 3px rgba(250, 79, 54, 0.1);
}

.exec-otp-input::placeholder {
    color: var(--exec-text-muted);
}

.exec-otp-input.error {
    border-color: var(--exec-error);
    background: #fff5f5;
}

.exec-otp-input.success {
    border-color: var(--exec-success);
    background: #f0fff4;
}

/* OTP Code Input - Special Styling */
.exec-otp-code-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.exec-otp-code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--exec-deep-blue);
    background: var(--exec-light-grey);
    border: 2px solid var(--exec-border-color);
    border-radius: 8px;
    transition: var(--exec-transition);
}

.exec-otp-code-input:focus {
    outline: none;
    border-color: var(--exec-bright-orange);
    background: var(--exec-white);
    box-shadow: 0 0 0 3px rgba(250, 79, 54, 0.15);
}

.exec-otp-code-input.filled {
    border-color: var(--exec-bright-orange);
    background: var(--exec-white);
}

.exec-otp-code-input.error {
    border-color: var(--exec-error);
    animation: shake 0.4s ease;
}

/* Single OTP input (for simpler forms) */
.exec-otp-input.otp-code {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5rem;
    padding: 1rem;
}

/* Buttons */
.exec-otp-button {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--exec-white);
    background: var(--exec-bright-orange);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--exec-transition);
}

.exec-otp-button:hover {
    background: var(--exec-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(250, 79, 54, 0.3);
}

.exec-otp-button:active {
    transform: translateY(0);
}

.exec-otp-button:disabled {
    background: var(--exec-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.exec-otp-button.secondary {
    background: var(--exec-deep-blue);
}

.exec-otp-button.secondary:hover {
    background: #1a1f3a;
}

/* Button Loading State */
.exec-otp-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.exec-otp-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--exec-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Messages */
.exec-otp-message {
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.exec-otp-message.hidden {
    display: none;
}

.exec-otp-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.exec-otp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.exec-otp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.exec-otp-message.info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.exec-otp-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Footer Links */
.exec-otp-footer {
    padding: 1rem 1.5rem;
    background: var(--exec-light-grey);
    text-align: center;
    border-top: 1px solid var(--exec-border-color);
}

.exec-otp-footer p {
    margin: 0;
    color: var(--exec-text-muted);
    font-size: 0.8125rem;
}

.exec-otp-link {
    color: var(--exec-bright-orange);
    text-decoration: none;
    font-weight: 600;
    transition: var(--exec-transition);
}

.exec-otp-link:hover {
    color: var(--exec-orange-hover);
    text-decoration: underline;
}

/* Resend Code Link */
.exec-otp-resend {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--exec-text-muted);
}

.exec-otp-resend button {
    background: none;
    border: none;
    color: var(--exec-bright-orange);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
}

.exec-otp-resend button:hover {
    text-decoration: underline;
}

.exec-otp-resend button:disabled {
    color: var(--exec-text-muted);
    cursor: not-allowed;
}

/* Timer */
.exec-otp-timer {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--exec-text-muted);
    margin-top: 0.75rem;
}

.exec-otp-timer strong {
    color: var(--exec-deep-blue);
}

/* Email Display */
.exec-otp-email {
    display: inline-block;
    background: var(--exec-light-grey);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9375rem;
    color: var(--exec-deep-blue);
}

/* Step Indicator */
.exec-otp-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.exec-otp-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--exec-light-grey);
    color: var(--exec-text-muted);
    border: 2px solid var(--exec-border-color);
}

.exec-otp-step.active {
    background: var(--exec-bright-orange);
    color: var(--exec-white);
    border-color: var(--exec-bright-orange);
}

.exec-otp-step.completed {
    background: var(--exec-success);
    color: var(--exec-white);
    border-color: var(--exec-success);
}

.exec-otp-step-line {
    width: 40px;
    height: 2px;
    background: var(--exec-border-color);
    align-self: center;
}

.exec-otp-step-line.active {
    background: var(--exec-bright-orange);
}

/* Powered By Footer */
.exec-otp-powered {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--exec-text-muted);
}

.exec-otp-powered a {
    color: var(--exec-text-muted);
    text-decoration: none;
}

.exec-otp-powered a:hover {
    color: var(--exec-bright-orange);
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

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

.exec-otp-form.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 480px) {
    .exec-otp-container {
        margin: 1rem;
        max-width: none;
    }
    
    .exec-otp-header {
        padding: 1.25rem;
    }
    
    .exec-otp-body {
        padding: 1.25rem;
    }
    
    .exec-otp-code-wrapper {
        gap: 0.35rem;
    }
    
    .exec-otp-code-input {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .exec-otp-button {
        padding: 0.875rem 1.25rem;
    }
}

/* Print Styles */
@media print {
    .exec-otp-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .exec-otp-button {
        display: none;
    }
}
