* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.step {
    display: none;
    flex: 1;
    flex-direction: column;
}

.step.active {
    display: flex;
    animation: fadeIn 0.4s ease-in;
}

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

h1 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
}

h2 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

.step > p, .test-desc {
    color: #666;
    text-align: center;
    margin-bottom: 35px;
    font-size: 15px;
    line-height: 1.6;
}

/* Phone input styling */
.phone-input-wrapper {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    overflow: visible;
    transition: all 0.3s;
}

.phone-input-wrapper:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.country-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 15px;
    background: #f0f0f0;
    border-right: 1px solid #ddd;
    cursor: pointer;
    border-radius: 12px 0 0 12px;
}

.flag {
    font-size: 24px;
    line-height: 1;
}

.country-code {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #333;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #ffc107;
}

.country-selector:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
}

#phoneNumber {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    transition: none;
}

#phoneNumber:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

button {
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 20px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

button.enabled {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7);
    }
}

.status {
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status.show {
    display: block;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.code-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    border: 2px dashed #667eea;
}

.code-display p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.code {
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    font-size: 28px;
    display: block;
    margin-top: 10px;
    letter-spacing: 3px;
}

.otp-input-container {
    margin-bottom: 20px;
}

#otp1, #otp3 {
    width: 100%;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 24px;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
    transition: all 0.3s;
    background: #fafafa;
}

#otp1:focus, #otp3:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.otp-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.otp-box {
    width: 55px;
    height: 65px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 28px;
    text-align: center;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    background: #fafafa;
}

.otp-box:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.result {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    margin-top: 20px;
    display: none;
}

.result.show {
    display: block;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.final-results {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.results-summary {
    padding: 35px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.results-summary.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.results-summary.partial {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #856404;
}

.results-summary h3 {
    font-size: 32px;
    margin-bottom: 15px;
}

.results-summary p {
    font-size: 18px;
}

.test-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.test-result-item {
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    font-size: 16px;
}

.test-result-item.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-result-item.failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 600px) {
    .container {
        padding: 35px 25px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .otp-box {
        width: 45px;
        height: 58px;
        font-size: 24px;
        gap: 6px;
    }
    
    .code {
        font-size: 24px;
    }
    
    .tooltip {
        font-size: 11px;
        padding: 8px 10px;
    }
}
