/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #faf5f0;
    color: #1a1a1a;
    min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    min-height: 100vh;
}
.screen.active { display: flex; flex-direction: column; }

.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* ===== LANGUAGE SELECTION ===== */
.lang-card {
    text-align: center;
    max-width: 600px;
    width: 100%;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.page-subtitle {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 32px;
}
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.lang-btn {
    background: #fff;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a3a2e;
}
.lang-btn:hover {
    border-color: #0d3320;
    background: #f0faf5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.lang-btn:active { transform: translateY(0); }
.lang-btn .lang-native {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 2px;
}
.lang-btn .lang-english {
    display: block;
    font-size: 0.7rem;
    color: #999;
    font-weight: 400;
}
.lang-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.login-card .page-title {
    text-align: center;
    margin-bottom: 4px;
}
.login-card .page-subtitle {
    text-align: center;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-group input:focus {
    border-color: #0d3320;
    box-shadow: 0 0 0 3px rgba(13,51,32,0.08);
}
.form-group input::placeholder { color: #bbb; }

.pin-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pin-wrap input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.pin-wrap input:focus {
    border-color: #0d3320;
    box-shadow: 0 0 0 3px rgba(13,51,32,0.08);
}
.pin-wrap input::placeholder { color: #bbb; }
.toggle-pin {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.toggle-pin:hover { color: #333; }

.forgot-row {
    text-align: right;
    margin-bottom: 20px;
}
.forgot-link {
    font-size: 0.82rem;
    color: #0d3320;
    text-decoration: underline;
    font-weight: 500;
}
.forgot-link:hover { color: #1a5c3a; }

/* ===== LOGIN BUTTON ===== */
.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    background: #0d3320;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
.btn-login:hover {
    background: #1a5c3a;
    box-shadow: 0 4px 16px rgba(13,51,32,0.25);
}
.btn-login:active { background: #0a2619; }
.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.back-row {
    text-align: center;
    margin-top: 16px;
}
.back-link {
    font-size: 0.82rem;
    color: #888;
    text-decoration: none;
    font-weight: 400;
}
.back-link:hover { color: #0d3320; text-decoration: underline; }

/* ===== LOGIN ERROR ===== */
.login-error {
    margin-top: 16px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== TOP NAV (after login) ===== */
.top-nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.shop-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}
.btn-logout {
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}
.btn-logout:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

/* ===== DETAILS SCREEN ===== */
.details-container {
    align-items: flex-start;
    padding-top: 48px;
}
.details-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
}
.details-icon {
    margin-bottom: 20px;
}
.details-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.details-agency {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 32px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.info-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.info-label {
    font-size: 0.82rem;
    color: #888;
    font-weight: 500;
}
.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    font-weight: 600;
    color: #0d3320;
}

/* ===== SPINNER ===== */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e5e5;
    border-top-color: #0d3320;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner.large { width: 40px; height: 40px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .container { padding: 24px 16px; }
    .login-card { padding: 28px 24px 24px; }
    .page-title { font-size: 1.4rem; }
    .lang-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .lang-btn { padding: 10px 6px; font-size: 0.85rem; }
    .nav-inner { padding: 10px 16px; }
    .shop-name { font-size: 0.78rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .details-container { padding-top: 24px; }
    .details-title { font-size: 1.2rem; }
    .info-item { padding: 12px 14px; }
}
