:root {
    --primary-blue: #0b3a6e;
    --border-light: #d5e0ec;
    --text-muted: #5d6f83;
    --panel-bg: #ffffff;
}

.page-shell {
    padding: 20px 16px 28px;
    background: #f4f7fb;
}

.page-panel {
    max-width: 800px;
    margin: 0 auto;
    background: var(--panel-bg);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.page-head {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.page-title {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.page-title #generated-number {
    display: inline;
    margin-left: 8px;
    color: var(--primary-blue);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.form-body {
    padding-bottom: 4px;
}

.custom-form {
    margin: 0;
    background: #fff;
    padding: 0;
}

.custom-form h2 {
    font-size: 1.2rem;
    margin: 20px 20px 14px;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 6px;
    text-align: left;
}

.custom-form label {
    font-weight: 700;
    margin-right: 10px;
    color: #444;
}

.custom-form .form-group {
    margin: 0 20px 1.1rem;
}

.custom-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #444;
}

.custom-form .form-control,
.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="date"],
.custom-form select,
.custom-form textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-form .form-control,
.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form input[type="date"],
.custom-form select {
    min-height: 38px;
    padding: 8px 10px;
}

.custom-form textarea {
    padding: 10px;
    min-height: 96px;
    resize: vertical;
}

.custom-form .mb-3 {
    margin: 0 20px 1.1rem;
}

.custom-form .mb-3.d-flex {
    display: grid !important;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.custom-form .mb-3.d-flex label {
    margin: 0;
}

.custom-form .mb-3.d-flex .form-control {
    width: 100% !important;
    max-width: 100%;
}

.custom-form .mb-3.d-flex .me-2 {
    margin-right: 0 !important;
}

.custom-form input[type="text"]:focus,
.custom-form input[type="date"]:focus,
.custom-form textarea:focus,
.custom-form select:focus,
.custom-form input[type="file"]:focus {
    border-color: #0056b3;
    outline: none;
}

.custom-form .form-check {
    margin: 0 20px 14px;
    padding-left: 1.5rem;
}

.custom-form .form-check-label {
    margin-left: 0.35rem;
    color: #555;
    cursor: default;
}

.form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px solid var(--primary-blue, #003d79);
    width: 100%;
}

.form-actions .btn {
    min-width: 96px;
}

.custom-form .required::after,
.custom-form label.required::after {
    content: " *";
    color: #d11a2a;
}

.custom-form button {
    background-color: #0056b3;
    color: #fff;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.975rem;
    transition: background-color 0.3s;
}

.custom-form button:hover {
    background-color: #003f8a;
}

.custom-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.custom-form.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.custom-form .mt-4 {
    margin-top: 1.5rem;
}

.custom-form .me-2 {
    margin-right: 0.5rem;
}

.message {
    color: red;
    text-align: center;
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .custom-form .mb-3.d-flex {
        grid-template-columns: 1fr;
    }

    .page-head {
        padding: 18px 18px 14px;
    }

    .page-title,
    .page-title #generated-number {
        font-size: 1.2rem;
    }
}
