/* MailTester — Professional, clean UI */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #FAFBFC;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Layout ---- */

.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.header-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brand .icon { font-size: 1.6rem; }

.header-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

.header-counter .count { color: var(--primary); font-weight: 700; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    transition: color .2s;
}

.header-nav a:hover { color: var(--primary); }

.header-account {
    color: var(--primary) !important;
    font-weight: 600 !important;
}

.header-logout {
    font-size: .82rem !important;
}

.header-login {
    color: var(--primary) !important;
    font-weight: 600 !important;
}

.lang-switch {
    font-size: .82rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all .2s;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* ---- Hero / Search ---- */

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.search-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s;
    color: var(--text);
    background: var(--bg);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.search-input::placeholder { color: #9CA3AF; }

.search-btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary);
    color: #FFF;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s, transform .1s;
    white-space: nowrap;
}

.search-btn:hover { background: var(--primary-dark); }
.search-btn:active { transform: scale(.98); }
.search-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---- Results ---- */

.results {
    display: none;
    margin-top: 24px;
}

.results.visible { display: block; }

.result-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all .3s;
}

.result-step.pending {
    opacity: .4;
}

.result-step.skipped {
    opacity: .5;
}

.result-step .step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.result-step.valid .step-icon {
    background: #D1FAE5;
    color: var(--success);
}

.result-step.invalid .step-icon {
    background: #FEE2E2;
    color: var(--danger);
}

.result-step.warning .step-icon {
    background: #FEF3C7;
    color: var(--warning);
}

.result-step.error .step-icon {
    background: #FEE2E2;
    color: var(--danger);
}

.result-step.skipped .step-icon {
    background: var(--border);
    color: var(--text-secondary);
}

.result-step .step-body {
    flex: 1;
}

.result-step .step-title {
    font-weight: 600;
    font-size: .95rem;
}

.result-step.valid .step-title { color: var(--success); }
.result-step.invalid .step-title { color: var(--danger); }
.result-step.error .step-title { color: var(--danger); }
.result-step.warning .step-title { color: var(--warning); }
.result-step.skipped .step-title { color: var(--text-secondary); }

/* Conclusion block */
.conclusion {
    display: none;
    margin-top: 20px;
    padding: 20px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    line-height: 1.7;
}

.conclusion.visible { display: block; }

.conclusion-valid {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
}

.conclusion-warning {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 8px;
}

.conclusion-invalid {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 8px;
}

.conclusion-detail {
    color: var(--text-secondary);
    font-size: .95rem;
    margin-top: 4px;
}

.price-period {
    font-size: .75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Score bar */
.score-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 18px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease, background .3s;
}

.score-label {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

/* Error message */
.error-msg {
    display: none;
    background: #FEE2E2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: .9rem;
}

.error-msg.visible { display: block; }

/* ---- Pricing ---- */

.pricing-section {
    margin-top: 48px;
}

.pricing-section h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pricing-section .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.pricing-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}

.pricing-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: var(--primary-light);
}

.pricing-card .tier-name {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pricing-card .tier-checks {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.pricing-card .tier-checks span {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pricing-card .tier-desc {
    font-size: .85rem;
    color: var(--text-secondary);
    margin: 10px 0 18px;
}

.pricing-card .tier-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.pricing-card .tier-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: .95rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all .2s;
    background: var(--primary);
    color: #FFF;
}

.pricing-card .tier-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.pricing-card.featured .tier-btn {
    background: var(--primary-dark);
}

.pricing-card.free .tier-btn {
    background: transparent;
    color: var(--primary);
    cursor: default;
}

/* ---- Footer ---- */

.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: .85rem;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .hero h1 { font-size: 1.6rem; }
    .search-form { flex-direction: column; }
    .search-btn { width: 100%; }
    .pricing-grid { grid-template-columns: 1fr; }
}
