/* =========================
   BASE
   (from app.css, adapted)
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* support both plain body and body.theme-alt from header.php */
body,
body.theme-alt {
    background: #181818;
    color: #ddd;
    font-family: system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* no body scroll, only internal */
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   HEADER
   (from app.css)
========================= */

.app-header {
    background: #141414;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    height: 33px;
}

.app-header-left,
.app-header-center,
.app-header-right {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.app-header-left {
    justify-content: flex-start;
}

.app-header-center {
    justify-content: center;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 600;
    color: #c8ced6;
}

.app-header-right {
    justify-content: flex-end;
}

.user-info {
    display: none;
}

.app-header i {
    transform: translateY(0);
    filter:
        drop-shadow(0 1px 1px rgba(255,255,255,.15))
        drop-shadow(0 2px 3px rgba(0,0,0,.85));
    transition: transform .12s ease, filter .12s ease;
}

.app-header a:hover i {
    transform: translateY(-1px);
}

.app-header a:active i {
    transform: translateY(1px);
}

.app-header .fa-house {
    color: #7b9bb5;
}

.app-header .fa-right-from-bracket {
    color: #7a2230 !important;
    filter: none;
}

/* =========================
   MAIN CONTAINER
   (from app.css, adapted)
========================= */

.app-container {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 12px 40px;

    display: flex;
    flex-direction: column;

    /* internal scroll for login content */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   TITLE
   (from app.css)
========================= */

.dash-title {
    text-align: center;
    font-weight: bold;
    margin: 2px 0 4px;
    color: #969da4 !important;
    font-size: 0.85rem;
    letter-spacing: 0.4px;
}

/* =========================
   GENERIC ACTION BUTTON
   (from app.css)
========================= */

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    background: #1b1b1b;
    border: 1px solid rgba(255,255,255,.25);
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 2px 4px rgba(0,0,0,.6);
}

/* =========================
   LOGIN PAGE — STANDALONE STYLE
   (specific for index.php)
========================= */

/* Layout contenitore pagina login */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 28px;
}

/* Card (box) — login + info */
.login-card {
    width: 100%;
    max-width: 420px;

    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 4px 10px rgba(0,0,0,.85);

    padding: 12px 12px 16px;
}

/* Messaggio sopra campi */
.login-message {
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #969da4;
    text-align: center;
}

.login-message-error {
    color: #ff6b6b;
}

/* Tabella campi */
.login-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.login-table tr {
    background: #222;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 2px 6px rgba(0,0,0,.7);
}

.login-table td {
    padding: 6px 8px;
}

/* Label sinistra */
.login-table .field-label {
    width: 70px;
    white-space: nowrap;
    color: #7b9bb5;
    font-size: 0.75rem;
}

/* Input (username + password) */
.login-input {
    width: 100%;
    box-sizing: border-box;

    background: #1b1b1b;
    color: #b8c2cc;

    border: 1px solid #444;
    border-radius: 6px;

    font-size: 0.8rem;
    padding: 8px 12px;
}

.login-input:focus {
    outline: none;
    border-color: #6ec1ff;
    background: #1b1b1b;
}

/* Pulsante login */
.login-buttons {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.login-btn {
    color: #2f7a5a;
    font-weight: bold;
    font-size: 0.9rem;
}

.login-btn i {
    color: #2f7a5a;
}

/* Info box */
.login-info-card {
    margin-top: 4px;
}

.login-info-text {
    font-size: 0.8rem;
    color: #8a939c;
    line-height: 1.5;
    text-align: justify;
}

.login-info-title {
    text-align: center;
    margin-bottom: 4px;
    font-weight: 600;
    color: #aab3bd;
    font-size: 0.8rem;
}

/* Mobile refinement */
@media (max-width: 480px) {
    .login-card {
        border-radius: 10px;
        padding: 10px 10px 14px;
    }
}

/* =========================
   SCROLLBAR (PAGE)
   (from app.css)
========================= */

* {
    scrollbar-width: thin;
    scrollbar-color: #7b9bb5 #181818;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #181818;
}

::-webkit-scrollbar-thumb {
    background-color: #7b9bb5;
    border-radius: 8px;
    border: 2px solid #181818;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #9bb6cc;
}

/* =========================
   FOOTER
   (from app.css, matches footer.php)
========================= */

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 0.6rem;
    color: #777;
    background: #181818;
    border-top: 1px solid #222;
}

/* =========================
   HR
   (from app.css)
========================= */

hr {
    border: none;
    border-top: 1px solid rgba(110,193,255,.25);
    margin: 6px 0;
}

/* =========================
   LOGIN INPUT — FORCE THEME
   Override browser/autofill yellow
========================= */

.login-input {
    width: 100%;
    box-sizing: border-box;

    background: #1b1b1b !important;
    color: #b8c2cc !important;
    border: 1px solid #444 !important;
    border-radius: 6px;

    font-size: 16px; /* FIX iPhone zoom */
    padding: 8px 12px;

    caret-color: #b8c2cc;
}

/* Autofill override (Chrome / Edge / Opera) */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px #2a2a2a inset !important;
    -webkit-text-fill-color: #b8c2cc !important;
    caret-color: #b8c2cc !important;
}

/* Firefox autofill */
.login-input:-moz-autofill {
    box-shadow: 0 0 0 40px #2a2a2a inset !important;
    -moz-text-fill-color: #b8c2cc !important;
    caret-color: #b8c2cc !important;
}

/* === Login buttons alignment === */
.login-card form .login-buttons{
    width: 100%;
    display: flex !important;
    justify-content: flex-start !important;
}

.login-card form .login-management{
    width: 100%;
    margin-top: 6px;
    display: flex !important;
    justify-content: flex-end !important;
}

/* === iOS Safari anti-auto-zoom (global safeguard) === */
input,
select,
textarea {
    font-size: 16px !important;
}
