:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 0 2rem;
    height: 72px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo i {
    font-size: 1.8rem;
}

/* Main */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.validator-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}

.validator-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

#emailInput {
    width: 100%;
    padding: 1.1rem 1.2rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

#emailInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.input-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(79, 70, 229, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.icon-btn {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--text-main);
    border-color: #d1d5db;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Result Card */
.result-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 1.75rem;
    animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.result-card.hidden {
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-actions .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-width: 1px;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--success-color) 0%, var(--border-color) 0);
    margin-bottom: 0.75rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 74px;
    height: 74px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.score-text {
    position: relative;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

.score-container span {
    font-weight: 500;
    color: var(--text-muted);
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: var(--text-main);
}

#resEmail {
    word-break: break-all;
    max-width: 60%;
    text-align: right;
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge.success { background: #d1fae5; color: #065f46; }
.badge.error { background: #fee2e2; color: #991b1b; }
.badge.warning { background: #fef3c7; color: #92400e; }

/* Status coloring */
.result-card.valid {
    border-color: #a7f3d0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}
.result-card.valid .result-header h3 { color: var(--success-color); }

.result-card.invalid {
    border-color: #fecaca;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}
.result-card.invalid .result-header h3 { color: var(--error-color); }

/* Footer */
.footer {
    background: white;
    padding: 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer .links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 0.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer .links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive */
@media (min-width: 640px) {
    .input-group {
        flex-direction: row;
    }
    #emailInput {
        margin-bottom: 0;
    }
    .input-actions {
        flex-shrink: 0;
    }
}
