:root {
    --bg-main: #f4f8fb;
    --surface: #ffffff;
    --text: #0f2940;
    --muted: #4e6b84;
    --primary: #1f6ea7;
    --primary-dark: #15527d;
    --border: #d7e6f2;
    --success: #1f8a59;
    --shadow: 0 10px 24px rgba(15, 41, 64, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans Devanagari", "Nirmala UI", "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(165deg, #e7f2fa 0%, #f7fbff 35%, #ecf6fb 100%);
    min-height: 100vh;
}

.page-banner {
    width: 100%;
    height: 20vh;
    min-height: 120px;
    max-height: 260px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(15, 41, 64, 0.1);
}

@media (min-width: 720px) {
    .page-banner {
        display: none;
    }
}

.page-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.container {
    width: min(100% - 2rem, 920px);
    margin-inline: auto;
    padding: 1rem 0 2.2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 0.5rem;
    object-fit: contain;
    border-radius: 50%;
}

h1,
h2 {
    margin: 0.25rem 0;
    line-height: 1.3;
}

.subtitle,
.small {
    color: var(--muted);
    margin: 0.5rem 0;
}

.notice {
    background: #e8f4fd;
    color: #0f4368;
    border: 1px solid #bcdcf3;
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 600;
    margin: 0.75rem 0 1rem;
}

.form-grid {
    display: grid;
    gap: 0.85rem;
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
}

select,
input[type="text"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    border: 1px solid #b8d3e6;
    border-radius: 10px;
    padding: 0.75rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 105px;
    resize: vertical;
}

.question-item {
    border: 1px dashed #b7d0e4;
    border-radius: 10px;
    padding: 0.75rem;
    background: #fafdff;
}

.subject-group {
    border: 1px solid #cfe0ed;
    border-radius: 12px;
    padding: 0.85rem;
    background: #fcfeff;
    margin-bottom: 0.9rem;
}

.subject-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.group-title {
    margin: 0;
    font-size: 1rem;
}

.questions-container {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.group-actions {
    margin-top: 0.7rem;
}

.submit-actions {
    margin-top: 0.25rem;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

button,
.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 0.72rem 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover,
.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #5f7f99;
}

.btn-secondary:hover {
    background: #47657d;
}

.btn-add-subject {
    background: #0f7c6b;
}

.btn-add-subject:hover {
    background: #0b6456;
}

.btn-add-question {
    background: #c46f1a;
}

.btn-add-question:hover {
    background: #a95d13;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.lang-switch {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.5rem 0 1rem;
}

.lang-switch a {
    text-decoration: none;
    border: 1px solid #b7d3e8;
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
}

.lang-switch a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.error {
    background: #ffeceb;
    color: #a2231d;
    border: 1px solid #f1bbb8;
    border-radius: 10px;
    padding: 0.65rem;
}

.success {
    color: var(--success);
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 620px;
}

th,
td {
    padding: 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    background: #f1f7fc;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.footer-note {
    text-align: center;
    color: var(--muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

@media (min-width: 720px) {
    .page-banner img {
        width: 100%;
        height: 100%;
        object-fit: fill;          /* full image, stretch allowed */
    }

    .container {
        padding-top: 1.5rem;
    }

    .card {
        padding: 1.35rem;
    }

    .row.two {
        flex-direction: row;
        align-items: end;
    }

    .row.two > div {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .subject-group {
        padding: 0.75rem;
    }

    .subject-group-head {
        align-items: stretch;
    }

    .subject-group-head .btn {
        width: 100%;
    }
}
