/* ==========================================================================
   Anjaneya Tiffins — Batch Verification page
   Brand color is a single CSS variable — swap --brand-primary (and
   --brand-primary-dark if you want a matching hover/darker shade) once
   the real hex codes are provided.
   ========================================================================== */

:root {
    --brand-primary: #1e5fbf;
    --brand-primary-dark: #164a94;
    --brand-bg: #fde5d2;
    --text-main: #1a1a1a;
    --text-muted: #5c6773;
    --border-color: #d6dee8;
    --success-bg: #f0f7f0;
    --success-border: #b7ddb9;
    --result-address-text: #44505b;
    --error-bg: #fdf0f0;
    --error-border: #e6b4b4;
    --error-text: #b00020;
    /* Muted, on-brand "double-check and retry" tone — not a hard red error */
    --warning-bg: #fff4e6;
    --warning-border: #f0d9b5;
    --warning-text: #8a5a00;
    /* Neutral gray for a technical/network failure, distinct from both above */
    --network-bg: #f4f4f4;
    --network-border: #dcdcdc;
    --network-text: #4a4a4a;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

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

.page {
    min-height: 100vh;
    min-height: 100dvh; /* accounts for mobile browser chrome (address bar, etc.) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px 24px;
    text-align: center;
}

.logo {
    max-width: 160px;
    max-height: 80px;
    margin: 0 auto 20px;
    display: block;
}

.logo[src=""], .logo.logo-hidden {
    display: none;
}

.heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-main);
}

.subtext {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 28px;
    line-height: 1.5;
}

/* Boxed 3-character batch input */
.batch-input-group {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
}

.batch-char {
    width: 60px;
    height: 64px;
    min-width: 44px;
    min-height: 44px;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.batch-char:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(30, 95, 191, 0.15);
}

.batch-char.filled {
    border-color: var(--brand-primary);
}

/* Verify button */
button[type="submit"] {
    width: 100%;
    min-height: 44px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--brand-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

button[type="submit"]:hover:not(:disabled) {
    background: var(--brand-primary-dark);
}

button[type="submit"]:disabled {
    background: var(--border-color);
    color: #8a97a6;
    cursor: not-allowed;
}

button[type="submit"].loading {
    position: relative;
    color: transparent;
}

.btn-spinner {
    display: none;
}

button[type="submit"].loading .btn-spinner {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

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

/* Result area */
.result {
    margin-top: 24px;
    text-align: left;
    border-radius: 12px;
    padding: 20px;
    animation: fade-in 0.25s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.result.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.result.not-found {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    text-align: center;
}

.result.network-error {
    background: var(--network-bg);
    border: 1px solid var(--network-border);
    text-align: center;
}

/* Success header: checkmark + trust tagline + live-check indicator */
.result-verified-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
}

.result-verified-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    animation: pop-in 0.25s ease-out;
}

@keyframes pop-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.result-verified-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary-dark);
}

.result-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.result-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.result-name {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-main);
    line-height: 1.35;
    overflow-wrap: break-word;
}

.result-address {
    font-size: 14px;
    color: var(--result-address-text);
    margin: 0 0 16px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

/* FSSAI compliance box — the actual proof point, given real visual weight */
.result-fssai {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--success-border);
    border-radius: 10px;
}

.result-fssai img {
    flex: 0 0 auto;
    height: 36px;
    width: auto;
}

.result-fssai img.logo-hidden {
    display: none;
}

.result-fssai-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-fssai-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.result-fssai-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.result-message {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.result.not-found .result-message {
    color: var(--warning-text);
}

.result.not-found .result-message a {
    color: var(--warning-text);
    font-weight: 600;
}

.result.network-error .result-message {
    color: var(--network-text);
}

.retry-button {
    display: inline-block;
    margin-top: 14px;
    min-height: 44px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-primary);
    background: #fff;
    border: 1px solid var(--brand-primary);
    border-radius: 8px;
    cursor: pointer;
}

.retry-button:hover {
    background: var(--brand-bg);
}

/* Credit line — deliberately subdued so it never competes with the
   trust signal or FSSAI block above it. */
.page-footer {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
    padding: 0 8px;
    text-align: center;
}

.page-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.page-footer a {
    color: var(--text-muted);
    font-weight: 700;
    text-decoration: underline;
}

.page-footer a:hover,
.page-footer a:focus {
    color: var(--text-main);
}

@media (max-width: 360px) {
    .batch-char {
        width: 52px;
        height: 56px;
        font-size: 22px;
    }
}
