/*
 * IP Blocker Lite - 2FA Form Styles
 * Version: 1.0.0
 * Description: Responsive styles for the two-factor authentication form
 */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f0f1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.02"/><circle cx="10" cy="50" r="0.5" fill="%23ffffff" opacity="0.02"/><circle cx="90" cy="30" r="0.5" fill="%23ffffff" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 40px;
    font-size: 20px !important;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
    letter-spacing: 0.025em;
}

input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.5em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1f2937;
    position: relative;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

input[type="text"]::placeholder {
    color: #9ca3af;
    letter-spacing: normal;
    opacity: 0.7;
}

.code-input-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: text;
}

.code-display {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    cursor: text;
}

.digit {
    width: 48px;
    height: 56px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: text;
    user-select: none;
}

.digit:hover {
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.digit.filled {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1), 0 4px 8px rgba(0,0,0,0.05);
}

.digit.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(0,0,0,0.1);
    transform: scale(1.05);
    animation: pulse 2s infinite;
}

.digit.hidden {
    opacity: 0.3;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1.08);
    }
}

.btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    letter-spacing: 0.025em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.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;
}

.btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 113, 177, 0.4);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
}

/* Button Container - Side by Side Layout */
.button-container {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.resend-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

/* Resend OTP Button */
.btn-resend {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.btn-resend:hover:not(:disabled) {
    background: #135e96;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.4);
}

.btn-resend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.resend-timer {
    color: #666;
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
}

.resend-timer #countdown {
    font-weight: 600;
    color: #2271b1;
}

.info {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    color: #0c4a6e;
    position: relative;
    font-size: 16px;
}

.info strong {
    color: #0369a1;
    font-weight: 600;
}

.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    color: #991b1b;
    position: relative;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.error strong {
    color: #dc2626;
    font-weight: 600;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    body {
        padding: 10px;
        background:#f0f0f1;

    .container {
        margin: 10px;
        padding: 30px 20px;
        border-radius: 16px;
        max-width: none;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 30px;
    }

    h1::after {
        width: 40px;
        height: 2px;
    }

    .info,
    .error {
        padding: 16px;
        margin-bottom: 25px;
        font-size: 14px;
        border-radius: 10px;
    }

    input[type="text"] {
        padding: 18px 20px;
        font-size: 20px;
        letter-spacing: 0.4em;
        border-radius: 10px;
    }

    .digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .btn {
        padding: 18px 32px;
        font-size: 16px;
        border-radius: 10px;
    }

    .form-group {
        margin-bottom: 25px;
    }

    /* Mobile button layout */
    .button-container {
        flex-direction: column;
        gap: 10px;
    }

    .resend-section {
        min-width: auto;
        width: 100%;
    }

    .btn-resend {
        width: 100%;
        padding: 12px 16px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) and (min-width: 481px) {
    .container {
        max-width: 420px;
        padding: 40px 30px;
    }

    h1 {
        font-size: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        border: 1px solid #333;
    }

    input[type="text"] {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    input[type="text"],
    .btn {
        transition: none;
    }
}

/* Validation states */
.form-group {
    position: relative;
}

input[type="text"].valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1), 0 4px 12px rgba(0,0,0,0.05);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

input[type="text"].invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 4px 12px rgba(0,0,0,0.05);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.validation-message {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    text-align: center;
    position: absolute;
    left: 0;
    right: 0;
    color: #991b1b;
}

.validation-message.show {
    opacity: 1;
    transform: translateY(0);
}

.validation-message.valid {
    color: #059669;
}

.validation-message.invalid {
    color: #dc2626;
}