/* body's rules now live in main.css - this used to redeclare them here
   too, and being the last-loaded of the three copies, silently won the
   cascade for min-height/margin/padding/width/overflow-x. */
html {
    height: 100%;
    text-align: left;
}

.container {
    width: 100%;
}



.navbar {
    z-index: 200;
}

/* The brand-blue top bar is deliberately the same color in both themes
   (like a flag, not a surface) - previously an inline 3-stop gradient of
   one repeated color, kept here as the flat color it actually rendered as. */
.top-navbar {
    background: #3761c2;
}

/* Second row (category menu + brand). Used to be Bootstrap's bare .bg-light,
   which never adapted to dark mode - the row stayed white while the text
   above it followed --text to light, so the "MathKG" brand went
   white-on-white and read as blank. */
.category-navbar {
    background: var(--surface);
    border-color: var(--border-subtle) !important;
    transition: background-color var(--transition-base), border-color var(--transition-base);
}

.navbar-brand-mathkgz {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    text-decoration: none;
}
.navbar-brand-mathkgz .accent {
    color: var(--color-heading-accent);
}

/* ════════════════════════════════════════════
   TOP UTILITY BAR — search + login/register/
   account pills. Bootstrap's default .btn-success
   gave these no hover motion and inconsistent
   spacing next to the search box; this brings them
   in line with the category nav's timing/radius.
════════════════════════════════════════════ */
#searchForm .form-control {
    width: 11.5rem;
    border-radius: var(--radius-sm);
    border: none;
}
#searchForm .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}
#searchForm .btn {
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast), filter var(--transition-fast);
}
#searchForm .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateY(-1px);
}
.theme-toggle-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.theme-toggle-icon--light { display: none; }
:root[data-theme="dark"] .theme-toggle-icon--dark { display: none; }
:root[data-theme="dark"] .theme-toggle-icon--light { display: inline; }

/* The two primary header actions (Кирүү / Катталуу when signed out,
   Аккаунт / Чыгуу when signed in) - deliberately just two buttons instead
   of the previous cluster that also repeated "Башкы бет" (the brand/logo
   link already goes home, so a separate button for it was redundant). */
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: .01em;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1.5px solid rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.header-action-btn:hover,
.header-action-btn:focus-visible {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    transform: translateY(-1px);
}
.header-action-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.header-action-btn--primary {
    background: #fff;
    color: #3761c2;
    border-color: #fff;
}
.header-test-link {
    white-space: nowrap;
}
.header-action-btn--primary:hover,
.header-action-btn--primary:focus-visible {
    background: rgba(255, 255, 255, .88);
    color: #3761c2;
}

@media (prefers-reduced-motion: reduce) {
    .header-action-btn,
    #searchForm .btn,
    .theme-toggle-btn {
        transition: none !important;
    }
    .header-action-btn:hover,
    #searchForm .btn:hover,
    .theme-toggle-btn:hover {
        transform: none;
    }
}

.offcanvas {
    top: 70px;
    height: calc(100% - 70px);
}

.no-scroll {
    overflow: hidden;
}

.navbar+.navbar {
       z-index: 80;
       top:10%;
    }



.box {
    border-radius: 5px;
    background-color: var(--surface);
    padding: auto;
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 5px;
    margin-top: 0;
    width: 180px;
    height: 40px;
    overflow-wrap: break-word;
    
}
  




 



  /* Button
  button {
    padding: 10px;
    border: 20px solid #ccc;
    width: 220px;
    height: 40px;
    /* font-size: 18px; 
    line-height: 1.5;
    color: #333;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    margin: 0;
  } */

  /* Display Account */
  .DisplayAccount {
    display: inline-block;
    border-radius: 50%;
    background-color: #9a1818;
  }
  
.no-scroll {
    overflow: hidden;
}


/* Update the link  */
a {
    color: rgb(0, 0, 0);
    text-decoration: none;
    line-height: 1.5rem;
    /*  */
    
}








/* ════════════════════════════════════════════
   PHONES — below the lg breakpoint the search,
   test and sign-in links fold into the hamburger
   menu. Visitors could not find Кирүү / Катталуу
   there, so the logo moves into the blue bar and
   the two sign-in buttons get their own row that
   is always in view.
════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .top-navbar .container-fluid {
        position: relative;
        min-height: 48px;
    }
    .top-navbar .navbar-toggler {
        border: 2px solid rgba(255, 255, 255, .85);
        border-radius: var(--radius-sm);
        padding: 6px 10px;
    }
    .top-navbar .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
    .top-navbar .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, .45);
    }
    .mobile-brand {
        position: absolute;
        /* Pinned to the first row, so an opened menu never runs under it. */
        left: 50%;
        top: 0;
        height: 46px;
        display: flex;
        align-items: center;
        transform: translateX(-50%);
        font-size: 1.6rem;
        color: #fff;
    }
    .mobile-brand .accent {
        color: #fff;
        opacity: .8;
    }
    .mobile-brand:hover,
    .mobile-brand:focus-visible {
        color: #fff;
    }

    .mobile-auth {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px 12px;
        background: var(--surface);
    }
    .mobile-auth-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 44px;
        padding: 0 12px;
        border: 2px solid #3761c2;
        border-radius: var(--radius-sm);
        background: transparent;
        color: #3761c2;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        transition: background var(--transition-fast);
    }
    .mobile-auth-name {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-auth-btn:hover,
    .mobile-auth-btn:focus-visible {
        background: var(--color-menu-active);
        color: #3761c2;
    }
    .mobile-auth-btn--primary,
    .mobile-auth-btn--primary:hover,
    .mobile-auth-btn--primary:focus-visible {
        background: #3761c2;
        color: #fff;
    }
    :root[data-theme="dark"] .mobile-auth-btn {
        border-color: var(--color-menu-border);
        color: var(--text);
    }
    :root[data-theme="dark"] .mobile-auth-btn--primary {
        background: #3761c2;
        border-color: #3761c2;
        color: #fff;
    }

    /* Only the collapsed category menu is left in the second row. */
    .category-navbar {
        padding-top: 0;
        padding-bottom: 0;
    }
}
