:root {
    --brand-navy: #002349;
    --brand-red: #d92228;
    --brand-green: #38a169;
    --brand-yellow: #d69e2e;
    --bg-light: #f4f6f8;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    color: #1a202c;
    line-height: 1.5;
}

/* Header */
.app-header {
    background: var(--brand-navy);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.container {
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Welcome / Instructions State */
.welcome-box {
    text-align: center;
    margin-top: 20px;
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.instruction-step {
    margin: 20px 0;
    text-align: left;
    display: flex;
    align-items: start;
    gap: 15px;
}

.step-num {
    background: var(--brand-navy);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Loading State */
.status-box {
    text-align: center;
    margin-top: 40px;
}

.pulse-ring {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--brand-navy);
    position: relative;
    animation: pulse 2s infinite;
}

.pulse-ring::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: var(--brand-navy);
    z-index: -1;
    animation: wave 2s infinite;
}

@keyframes wave {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

#status-text {
    margin-top: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--brand-navy);
}

/* Result Cards */
.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.card-header {
    padding: 20px;
    color: white;
    text-align: center;
}

.card-header h3 {
    margin: 10px 0 0 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

#card-badge {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.card-body {
    padding: 25px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.data-label { color: #64748b; font-size: 0.9rem; font-weight: 500; }
.data-val { font-weight: 700; color: #1e293b; text-align: right; }

.note-box {
    margin: 20px 0;
    padding: 15px;
    background: #fff8e1;
    border-left: 4px solid #f6c23e;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

.action-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px;
    background: var(--brand-navy);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0, 35, 73, 0.3);
    transition: transform 0.1s;
}

.action-btn:active { transform: scale(0.98); }

/* Card Variants */
.safe-zone .card-header { background: var(--brand-green); }
.danger-zone .card-header { background: var(--brand-red); }
.warn-zone .card-header { background: var(--brand-yellow); }

/* Manual Input Section */
.manual-input {
    margin-top: auto;
    padding-top: 30px;
    text-align: center;
}

.manual-details {
    margin-top: 15px;
}

input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--brand-navy); outline: none; }

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: #e2e8f0;
    color: var(--brand-navy);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.secondary-btn:hover { background: #cbd5e0; }

.hidden { display: none !important; }