/* ===========================================
   CSS Variables & Design Tokens
   =========================================== */
:root {
    --primary-color: #A8926D !important;
    --primary-hover: #8F7A56 !important;
    --primary-light: rgba(168, 146, 109, 0.1) !important;
    --text-color: #333 !important;
    --text-muted: #666 !important;
    --bg-light: #f8f9fa !important;
    --border-color: #dee2e6 !important;
    --error-color: #dc3545 !important;
    --success-color: #A8926D !important;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===========================================
   Font Face - Sandvik Sans
   =========================================== */
@font-face {
    font-family: 'Sandvik Sans';
    src: url('../fonts/Sandvik Sans/WOFF2/SandvikSansText-Regular.woff2') format('woff2'),
         url('../fonts/Sandvik Sans/WOFF/SandvikSansText-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sandvik Sans';
    src: url('../fonts/Sandvik Sans/WOFF2/SandvikSansText-Bold.woff2') format('woff2'),
         url('../fonts/Sandvik Sans/WOFF/SandvikSansText-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sandvik Sans';
    src: url('../fonts/Sandvik Sans/WOFF2/SandvikSansText-Light.woff2') format('woff2'),
         url('../fonts/Sandvik Sans/WOFF/SandvikSansText-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* ===========================================
   Base Typography
   Font: 1rem/150% Sandvik Sans, Tahoma, Verdana, sans-serif
   =========================================== */
html {
    font-size: 16px;
}

body {
    font: 1rem/150% 'Sandvik Sans', Tahoma, Verdana, sans-serif !important;
    color: var(--text-color);
    margin-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sandvik Sans', Tahoma, Verdana, sans-serif;
    font-weight: 700;
    line-height: 150%;
}

p, span, label, input, button, a {
    font: inherit;
}

/* ===========================================
   Layout
   =========================================== */
html {
    position: relative;
    min-height: 100%;
}

/* ===========================================
   Form Controls
   =========================================== */
.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

.form-control {
    font: 1rem/150% 'Sandvik Sans', Tahoma, Verdana, sans-serif;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ===========================================
   Primary Button
   =========================================== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font: 1rem/150% 'Sandvik Sans', Tahoma, Verdana, sans-serif;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 8px;
    transition: var(--transition);
    background: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* ===========================================
   Login Page Styles
   =========================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 420px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
/* ===========================================
   Header, Desktop Nav, Mobile Bottom Nav
   =========================================== */

/* Top non-interactive bar */
.topbar {
    background: var(--primary-color) !important;
    color: #000;
}
.topbar .app-logo {
    height: 44px;
    margin-left: 8px;
}
.topbar .header-right {
    color: #000;
    font-weight: 700;
    font-size: 1rem;
}

/* Main interactive navigation for desktop */
.main-nav {
    background: #fff;
}
.main-nav .desktop-nav .nav-link {
    color: #222 !important;
    margin-right: 14px;
    font-weight: 600;
    padding: 12px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.main-nav .desktop-nav .nav-link i {
    font-size: 1.05rem;
    color: var(--primary-color);
}
.main-nav .desktop-nav .nav-link:hover {
    color: var(--primary-hover) !important;
    background: var(--primary-light);
    border-radius: 6px;
}

.app-root {
    background: #fff;
}
.app-content {
    overflow-y: auto;
}

/* Mobile bottom navigation (fixed) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color) !important;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1040;
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    width: 20%;
}
.mobile-bottom-nav .nav-item .icon { font-size: 1.2rem; color: #fff; }
.mobile-bottom-nav .nav-item .label { font-size: 0.75rem; margin-top: 2px; color: #fff; }
.mobile-bottom-nav .nav-item.active, .mobile-bottom-nav .nav-item:hover, .mobile-bottom-nav .nav-item:focus {
    color: #000 !important;
    background: rgba(255,255,255,0.85);
    border-radius: 8px;
    padding: 6px 8px;
}

/* Ensure primary color applied forcefully where needed */
.bg-primary, .btn-primary { background: #A8926D !important; border-color: #A8926D !important; }
.text-primary { color: #A8926D !important; }

/* small helpers */
.header-right.small { font-size: 0.9rem; }
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
}

.login-step {
    display: none;
}

.login-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 44px;
}

.input-icon-wrapper .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ===========================================
   OTP Input Styles
   =========================================== */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.otp-input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

.otp-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.otp-timer {
    text-align: center;
    margin-bottom: 20px;
}

.otp-timer .timer {
    font-weight: 700;
    color: var(--primary-color);
}

.otp-timer.expired .timer {
    color: var(--error-color);
}

/* ===========================================
   Messages
   =========================================== */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.message.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.message.error {
    background: #fff5f5;
    color: var(--error-color);
    border: 1px solid #ffcccc;
}

.message.success {
    background: #f0fff4;
    color: var(--success-color);
    border: 1px solid #c6f6d5;
}

/* ===========================================
   Loading Spinner
   =========================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* ===========================================
   Back Link
   =========================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link svg {
    margin-right: 6px;
}

/* ===========================================
   Resend Link
   =========================================== */
.resend-otp {
    text-align: center;
    margin-top: 16px;
}

.resend-otp a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.resend-otp a:hover {
    text-decoration: underline;
}

.resend-otp a.disabled {
    color: var(--text-muted);
    pointer-events: none;
}

.btn.btn-primary {
    background-color: #A8926D !important;
    color: #000;
    font-size: 1.1rem;
}

/* ===========================================
   Header, Desktop Nav, Mobile Bottom Nav
   =========================================== */
.site-header {
    background: var(--primary-color) !important;
    color: #000;
}
.site-header .top-menu {
    max-height: 72px;
}
.site-header .app-logo {
    height: 44px;
    margin-left: 8px;
}
.site-header .header-right {
    color: #000;
    font-weight: 700;
    font-size: 1rem;
}
.desktop-nav .nav-link {
    color: #000 !important;
    margin-right: 12px;
    font-weight: 600;
}
.desktop-nav .nav-link:hover {
    color: #ffffff !important;
}

.app-root {
    background: #fff;
}
.app-content {
    overflow-y: auto;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    z-index: 1040;
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    width: 20%;
}
.mobile-bottom-nav .nav-item .icon { font-size: 1.25rem; color: var(--text-muted); }
.mobile-bottom-nav .nav-item .label { font-size: 0.75rem; margin-top: 2px; }
.mobile-bottom-nav .nav-item:hover, .mobile-bottom-nav .nav-item:focus {
    color: var(--primary-color) !important;
}

/* Ensure primary color applied forcefully where needed */
.bg-primary, .btn-primary, .site-header { background: #A8926D !important; }
.text-primary { color: #A8926D !important; }

/* ==========================
   Mobile bottom nav (rich, scrollable)
   ========================== */
.app-root { margin-bottom: 92px; padding-top: 112px; }
.mobile-bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 64px;
    background: var(--primary-color) !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    z-index: 1050;
    padding: 6px 8px;
    box-shadow: var(--shadow);
}
.mobile-bottom-inner { display:flex; align-items:center; width:100%; gap:8px; }
.mobile-bottom-nav .home-item {
    flex: 0 0 64px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color:#000;
    background: #fff;
    border-radius: 10px;
    text-decoration:none;
}
.mobile-bottom-nav .home-item .icon { color: var(--primary-color); font-size:1.15rem; }
.mobile-scroll {
    display:flex;
    gap:8px;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.mobile-scroll .nav-item {
    min-width:92px;
    flex:0 0 auto;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:center;
    color:#fff;
    text-decoration:none;
    padding:6px 12px;
    border-radius:8px;
    background: rgba(255,255,255,0.06);
    position:relative;
}
.mobile-scroll .nav-item .icon { font-size:1.05rem; color: #fff; margin-right:8px; }
.mobile-scroll .nav-item .label { font-size:0.8rem; margin:0; }
.mobile-scroll .nav-item .chev { display:none !important; }

/* scroll buttons (left/right) */
.mobile-scroll-btn {
    flex: 0 0 36px;
    width:36px;
    height:36px;
    border-radius:50%;
    background:#fff;
    color:var(--primary-color);
    display:flex !important;
    align-items:center;
    justify-content:center;
    border:0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.mobile-scroll-btn.d-none { display:none !important; }
.mobile-scroll-btn:active { transform: translateY(1px); }

/* ensure scroll container grows between buttons */
.mobile-scroll { flex: 1 1 auto; }
.mobile-scroll::-webkit-scrollbar { height:6px; }
.mobile-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius:3px; }
.mobile-bottom-nav .nav-item:active, .mobile-bottom-nav .nav-item:focus, .mobile-bottom-nav .nav-item:hover { background: rgba(255,255,255,0.12); color:#fff; }

/* Keep footer visible and consistent with primary background */
.footer, .footer.border-top.footer.text-muted {
    background: var(--primary-color) !important;
    color: #000 !important;
}
.footer a { color: rgba(0,0,0,0.85) !important; }

/* Make header fixed at top */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1060; }
.main-nav { position: relative; }

.desktop-nav .nav-link:hover {
    color: #a09797 !important;
}