/* TruSent — Web Check
   Mobile-first, clean, trustworthy design */

:root {
    --blue-600: #1a56db;
    --blue-700: #1e40af;
    --blue-50: #eff6ff;
    --green-600: #059669;
    --green-50: #ecfdf5;
    --green-100: #d1fae5;
    --red-600: #dc2626;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --orange-600: #d97706;
    --orange-50: #fffbeb;
    --orange-100: #fef3c7;
    --yellow-600: #ca8a04;
    --yellow-50: #fefce8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 0 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 36px;
    line-height: 1;
}

.logo h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--blue-700);
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Check Section */
.check-section {
    background: white;
    border-radius: var(--radius);
    padding: 28px 20px;
    box-shadow: var(--shadow-md);
    margin-top: 12px;
}

.check-section h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--gray-500);
    font-size: 15px;
    margin-bottom: 20px;
}

.check-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--gray-50);
}

.input-group input:focus {
    outline: none;
    border-color: var(--blue-600);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.input-group input::placeholder {
    color: var(--gray-400);
}

.input-group button {
    width: 100%;
    padding: 14px;
    background: var(--blue-600);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.input-group button:hover {
    background: var(--blue-700);
}

.input-group button:active {
    transform: scale(0.98);
}

.input-group button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.privacy-note {
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
}

/* Result Section */
.result-section {
    margin-top: 16px;
    animation: slideUp 0.3s ease-out;
}

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

.result-card {
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
}

.result-card.safe {
    background: var(--green-50);
    border: 2px solid var(--green-100);
}

.result-card.low {
    background: var(--yellow-50);
    border: 2px solid var(--orange-100);
}

.result-card.medium {
    background: var(--orange-50);
    border: 2px solid var(--orange-100);
}

.result-card.high {
    background: var(--red-50);
    border: 2px solid var(--red-100);
}

.result-card.critical {
    background: var(--red-50);
    border: 2px solid var(--red-100);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.result-icon {
    font-size: 40px;
    line-height: 1;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.result-card.safe .result-title { color: var(--green-600); }
.result-card.low .result-title { color: var(--orange-600); }
.result-card.medium .result-title { color: var(--orange-600); }
.result-card.high .result-title { color: var(--red-600); }
.result-card.critical .result-title { color: var(--red-600); }

.result-domain {
    font-size: 14px;
    color: var(--gray-500);
    font-family: monospace;
    word-break: break-all;
}

.result-explanation {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.result-score {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
}

.score-fill.safe { background: var(--green-600); }
.score-fill.low { background: var(--yellow-600); }
.score-fill.medium { background: var(--orange-600); }
.score-fill.high { background: var(--red-600); }
.score-fill.critical { background: var(--red-600); }

.score-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 40px;
    text-align: right;
}

.result-indicators {
    margin-bottom: 16px;
}

.result-indicators h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.indicator {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--gray-700);
}

.indicator::before {
    content: "⚠️";
    flex-shrink: 0;
}

.result-education {
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-600);
}

.result-education h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.result-safe-url {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.result-safe-url strong {
    color: var(--green-600);
}

.result-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.btn-share {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.btn-share:hover { opacity: 0.9; }

.btn-share.whatsapp {
    background: #25D366;
    color: white;
}

.btn-share.copy {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-report {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-500);
    cursor: pointer;
}

.btn-report:hover {
    background: var(--gray-100);
}

/* How it Works */
.how-it-works {
    margin-top: 32px;
    padding: 0 4px;
}

.how-it-works h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.step-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.step h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.step p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* Info Section */
.info-section {
    margin-top: 32px;
    padding: 0 4px;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.scam-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.scam-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.scam-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.scam-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.scam-card p {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* Stats */
.stats-section {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding: 20px;
    background: var(--blue-50);
    border-radius: var(--radius);
}

.stat {
    flex: 1;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--blue-700);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 24px 0 16px;
    text-align: center;
}

.footer p {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.footer-small {
    font-size: 12px !important;
    color: var(--gray-400) !important;
    margin-top: 4px;
}

/* Error state */
.error-message {
    background: var(--red-50);
    border: 1px solid var(--red-100);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--red-600);
    font-size: 14px;
    margin-top: 12px;
}

/* Desktop tweaks */
@media (min-width: 480px) {
    .container {
        padding: 24px;
    }

    .input-group {
        flex-direction: row;
    }

    .input-group button {
        width: auto;
        min-width: 140px;
        flex-shrink: 0;
    }

    .check-section h2 {
        font-size: 28px;
    }
}

@media (min-width: 640px) {
    .container {
        padding: 32px;
    }
}
