:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #059669;
    --error-color: #dc2626;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
}

.hidden { display: none !important; }

/* Auth */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin-top: 5rem;
}

.auth-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.auth-card h1 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* App Layout */
.app-container {
    width: 100%;
    max-width: 600px;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Tiles */
.tile {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.view h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.image-container img {
    border-radius: 0.5rem;
    object-fit: cover;
}

/* Forms & Buttons */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

input, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success { background-color: var(--success-color); }
.btn-success:hover { background-color: #047857; }

/* Results */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.value-container {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary-color);
    margin-left: 0.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.difference-container {
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.diff-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-ok { background: #dcfce7; color: #166534; }
.status-error { background: #fee2e2; color: #991b1b; }

.explanation-container {
    margin-bottom: 2rem;
}

.explanation-container label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

textarea { height: 100px; resize: none; }

/* Loader */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-text { color: var(--error-color); margin-top: 1rem; font-size: 0.875rem; }
