:root {
    /* Amazon-like Colors */
    --amz-dark: #131921;
    --amz-darker: #0F1111;
    --amz-orange: #FF9900;
    --amz-yellow: #FFD814;
    --amz-yellow-hover: #F7CA00;
    --amz-bg: #EAEDED;
    --amz-white: #FFFFFF;
    --amz-border: #D5D9D9;
    --amz-text: #0F1111;
    --amz-text-muted: #565959;
    --amz-link: #007185;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

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

/* --- Login Page --- */
.login-body {
    background-color: var(--amz-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
}

.login-container {
    width: 100%;
    max-width: 350px;
    padding: 0 15px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}
.logo-container h1 {
    font-size: 24px;
    font-weight: 500;
}

.login-box {
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 20px 25px;
    background: var(--amz-white);
}

.login-box h2 {
    font-weight: 400;
    font-size: 28px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}
.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #a6a6a6;
    border-radius: 3px;
    font-size: 14px;
}
.form-group input:focus {
    outline: none;
    border-color: var(--amz-orange);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.3);
}

.amz-btn {
    width: 100%;
    background-color: var(--amz-yellow);
    border: 1px solid #FCD200;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(15,17,17,.15);
    transition: background-color 0.2s;
}
.amz-btn:hover {
    background-color: var(--amz-yellow-hover);
}

.alert.error {
    color: #c40000;
    font-size: 13px;
    margin-bottom: 15px;
}

/* --- Main App Header --- */
.app-header {
    background-color: var(--amz-dark);
    color: var(--amz-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.username {
    font-size: 14px;
    opacity: 0.9;
}
.logout-link {
    color: var(--amz-white);
    display: flex;
    align-items: center;
    opacity: 0.8;
}

/* --- Main Content --- */
.app-main {
    padding: 10px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 70px;
}

.state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    color: var(--amz-text-muted);
}
.hidden {
    display: none !important;
}
.state-container .emoji {
    font-size: 48px;
    margin-bottom: 10px;
}
.state-container p {
    font-size: 18px;
    font-weight: 500;
    color: var(--amz-text);
}
.state-container .subtitle {
    font-size: 14px;
    color: var(--amz-text-muted);
}

.spinner {
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: var(--amz-orange);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Shopping List Items --- */
.shopping-list {
    list-style: none;
    background: var(--amz-white);
    border-radius: 8px;
    border: 1px solid var(--amz-border);
    overflow: hidden;
}
.shopping-list.hidden {
    display: none;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--amz-border);
    transition: all 0.4s ease;
    cursor: pointer;
}
.list-item:last-child {
    border-bottom: none;
}
.list-item:active {
    background-color: #f7f7f7;
}

/* Custom Checkbox */
.check-circle {
    width: 24px;
    height: 24px;
    border: 2px solid var(--amz-text-muted);
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.check-circle svg {
    width: 14px;
    height: 14px;
    stroke: var(--amz-white);
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.item-name {
    font-size: 17px;
    transition: all 0.2s;
    user-select: none;
}

/* Checked State Animation */
.list-item.checking .check-circle {
    background-color: #008700;
    border-color: #008700;
}
.list-item.checking .check-circle svg {
    opacity: 1;
}
.list-item.checking .item-name {
    text-decoration: line-through;
    color: var(--amz-text-muted);
}
.list-item.fade-out {
    opacity: 0;
    transform: translateX(20px);
}

/* --- Footer --- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--amz-white);
    border-top: 1px solid var(--amz-border);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.last-updated {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.update-text {
    font-size: 11px;
    color: var(--amz-text-muted);
}
.disclaimer {
    font-size: 13px;
    font-weight: 600;
    color: #008700;
    margin-bottom: 2px;
}
.disclaimer.hidden {
    display: none;
}
.commit-btn {
    background-color: #008700;
    color: var(--amz-white);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
    flex-shrink: 0;
}
.commit-btn:disabled {
    background-color: #d5d9d9;
    box-shadow: none;
    cursor: not-allowed;
    color: #a6a6a6;
}
.commit-btn.spinning svg {
    animation: spin 1s linear infinite;
}
