/* style.css  */

:root {

    --primary-color: #2563EB;      
    --primary-hover: #1D4ED8;       
    
    --success-color: #10B981;       
    --warning-color: #F59E0B;       
    --danger-color: #EF4444;        
    
    --bg-color: #F3F4F6;            
    --card-bg: #FFFFFF;             
    
    --text-main: #1F2937;           
    --text-muted: #6B7280;          
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    --radius-md: 12px;              
    --radius-lg: 20px;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding-bottom: 80px; 
    -webkit-tap-highlight-color: transparent; 
}

h1, h2, h3 { color: var(--text-main); font-weight: 700; margin-top: 0; }
a { text-decoration: none; }


.container {
    padding: 20px;
    max-width: 600px; 
    margin: 0 auto;
}

.header {
    background: var(--card-bg);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-title { margin: 0; font-size: 20px; }

/* (Card) */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03); 
    transition: transform 0.2s;
}

.card:active { transform: scale(0.99); }

/* (Button System) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:active { background: var(--primary-hover); }

.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--text-muted); color: var(--text-muted); }

/*  (Badges) */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-active { background: #D1FAE5; color: #065F46; } 
.badge-pending { background: #FEF3C7; color: #92400E; } 
.badge-rejected { background: #FEE2E2; color: #991B1B; } 


.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border-top: 1px solid #eee;
    display: flex;
    padding-bottom: env(safe-area-inset-bottom); 
    height: 60px;
    z-index: 999;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 10px;
}
.nav-item i { font-size: 22px; margin-bottom: 4px; }
.nav-item.active { color: var(--primary-color); }


/* Authentication pages */
.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 32px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.14), transparent 34%),
        linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 45%, #F3F4F6 100%);
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: white;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
}

.brand-logo img {
    width: 46px;
    height: 46px;
    display: block;
    object-fit: contain;
}

.brand-copy {
    text-align: left;
}

.brand-name {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    color: var(--text-main);
}

.brand-tagline {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-title {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.2;
    color: var(--text-main);
}

.auth-subtitle {
    display: block;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.input-group {
    margin: 0;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 650;
}

.input-shell {
    position: relative;
}

.input-shell > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94A3B8;
    font-size: 14px;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-card input,
.auth-card select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #DDE3EA;
    border-radius: 12px;
    background: #F8FAFC;
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.input-shell input,
.input-shell select {
    padding-left: 42px;
}

.input-shell.has-action input {
    padding-right: 46px;
}

.auth-card input:focus,
.auth-card select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: #EAF1F8;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -2px;
    font-size: 13px;
}

.auth-link {
    color: var(--primary-color);
    font-weight: 650;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-card .btn {
    min-height: 48px;
    margin-top: 2px;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.auth-footer {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.error-msg,
.success-msg {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.error-msg {
    color: #B91C1C;
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.success-msg {
    color: #047857;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 2px 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.terms-row input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 1px 0 0;
    flex: 0 0 18px;
    accent-color: var(--primary-color);
}

.password-hint {
    margin-top: -6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
    box-sizing: border-box;
}

.modal-content {
    width: 100%;
    max-width: 520px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: #F8FAFC;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    color: #4B5563;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.modal-body h4 {
    margin: 16px 0 5px;
    color: var(--primary-color);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    text-align: right;
}

.modal-footer .btn {
    width: auto;
}

.close-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #64748B;
    font-size: 24px;
    cursor: pointer;
}

.close-btn:hover {
    background: #E5E7EB;
}

#install-banner {
    display: none;
    position: fixed;
    top: 14px;
    left: 50%;
    width: min(92%, 520px);
    z-index: 1000;
    padding: 10px 12px;
    color: white;
    background: #1E40AF;
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(30, 64, 175, 0.28);
    box-sizing: border-box;
    transform: translateX(-50%);
    animation: slideDown 0.35s ease;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.banner-text,
.banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-install {
    padding: 7px 14px;
    border: none;
    border-radius: 999px;
    color: #1E40AF;
    background: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.close-banner {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    font-size: 20px;
    cursor: pointer;
}

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 460px) {
    .auth-page {
        align-items: flex-start;
        padding: 24px 14px;
    }

    .auth-page.auth-login {
        align-items: center;
    }

    .auth-card {
        padding: 22px;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 24px;
    }
}
