/* ============================================================
   general.css — global base styles loaded on every page
   ============================================================ */

/* ── Box-sizing & reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    color: #1a1a1a;
    -webkit-text-size-adjust: 100%;
}

/* ── Images ── */
img {
    max-width: 100%;
    height: auto;
}

/* ── Links ── */
a {
    color: inherit;
}

/* ── Page wrapper — keeps content from touching screen edges ── */
.page-wrapper {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Alerts wrapper ── */
.alerts-wrapper {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 1055;
    width: min(380px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Utility: full-width button on small screens ── */
@media (max-width: 575.98px) {
    .btn-mobile-full {
        width: 100%;
    }
}

/* ── Form controls — comfortable tap targets on mobile ── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }

    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Tables — horizontal scroll on mobile ── */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Section spacing ── */
@media (max-width: 768px) {
    .section-padding {
        padding: 32px 0;
    }
}

/* ── Cards — prevent overflow ── */
.card {
    word-break: break-word;
}

/* ── Django messages — don't overlap header ── */
.alert {
    word-break: break-word;
}
