/* ===========================================================
   Add Developer — Modern Form Layout
   =========================================================== */

:root {
    --ad-bg: #f5f7fb;
    --ad-card: #ffffff;
    --ad-border: #e6eaf0;
    --ad-border-strong: #d4d9e2;
    --ad-text: #1f2733;
    --ad-text-muted: #6b7280;
    --ad-text-soft: #9aa3b2;
    --ad-accent: #2f63ff;
    --ad-accent-soft: #eaf0ff;
    --ad-accent-hover: #1f4ee0;
    --ad-required: #e63946;
    --ad-success: #10b981;
    --ad-radius: 14px;
    --ad-radius-sm: 10px;
    --ad-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ad-page {
    background: var(--ad-bg);
    padding: 32px 0 64px;
    font-family: "Roboto", system-ui, -apple-system, sans-serif;
    color: var(--ad-text);
    padding-top: 100px;
}


.ad-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page header */
.ad-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

    .ad-page-header h1 {
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -0.02em;
        margin: 0 0 4px;
    }

    .ad-page-header .ad-breadcrumb {
        font-size: 13px;
        color: var(--ad-text-muted);
    }

        .ad-page-header .ad-breadcrumb a {
            color: var(--ad-text-muted);
            text-decoration: none;
        }

            .ad-page-header .ad-breadcrumb a:hover {
                color: var(--ad-accent);
            }

.ad-mandatory-note {
    font-size: 13px;
    color: var(--ad-text-muted);
}

    .ad-mandatory-note .req {
        color: var(--ad-required);
        font-weight: 600;
    }

/* Section card */
.ad-section {
    background: var(--ad-card);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

    .ad-section:hover {
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.07);
    }

.ad-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--ad-border);
    background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.ad-section-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ad-accent-soft);
    color: var(--ad-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.ad-section-head h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: var(--ad-text);
}

.ad-section-head p {
    font-size: 13px;
    color: var(--ad-text-muted);
    margin: 2px 0 0;
}

.ad-section-head .ad-head-text {
    flex: 1;
}

.ad-section-body {
    padding: 28px;
}

/* Collapsible section */
.ad-section.collapsible .ad-section-head {
    cursor: pointer;
    user-select: none;
}

    .ad-section.collapsible .ad-section-head:hover {
        background: linear-gradient(180deg, #f4f7fc 0%, #fbfcfe 100%);
    }

    .ad-section.collapsible .ad-section-head .toggle-icon {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 1px solid var(--ad-border-strong);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ad-text-muted);
        transition: transform 0.25s, background 0.25s, color 0.25s;
        flex-shrink: 0;
    }

.ad-section.collapsible.open .toggle-icon {
    background: var(--ad-accent);
    color: #fff;
    border-color: var(--ad-accent);
    transform: rotate(180deg);
}

/* Smooth accordion slide */
.ad-section.collapsible .ad-section-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1), padding 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.ad-section.collapsible.open .ad-section-body {
    max-height: 4000px;
    padding-top: 28px;
    padding-bottom: 28px;
    opacity: 1;
    transition: max-height 0.7s cubic-bezier(0.22, 1, 0.36, 1), padding 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease 0.1s;
}

@media (max-width: 720px) {
    .ad-section.collapsible.open .ad-section-body {
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

/* Section status badge */
.ad-section-status {
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f1f3f7;
    color: var(--ad-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

    .ad-section-status.is-valid {
        background: #dcfce7;
        color: #15803d;
    }

    .ad-section-status.has-error {
        background: #fee2e2;
        color: #b91c1c;
    }

    .ad-section-status .status-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        opacity: 0.6;
    }

/* Section number reflects state */
.ad-section.has-error .ad-section-num {
    background: #fee2e2;
    color: #b91c1c;
}

.ad-section.is-valid .ad-section-num {
    background: #dcfce7;
    color: #15803d;
}

/* Error state on fields */
.ad-field.has-error .ad-input,
.ad-field.has-error .ad-select,
.ad-field.has-error .ad-textarea {
    border-color: var(--ad-required);
    background: #fef7f7;
}

    .ad-field.has-error .ad-input:focus,
    .ad-field.has-error .ad-select:focus,
    .ad-field.has-error .ad-textarea:focus {
        box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
    }

.ad-field.has-error .ad-file {
    border-color: var(--ad-required);
    background: #fef7f7;
}

.ad-error {
    display: none;
    font-size: 12px;
    color: var(--ad-required);
    margin-top: 6px;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

    .ad-error::before {
        content: "";
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e63946'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm0 3a1 1 0 011 1v4a1 1 0 11-2 0V5a1 1 0 011-1zm0 8a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }

.ad-field.has-error .ad-error {
    display: flex;
}

/* Valid hint */
.ad-field.is-valid .ad-input,
.ad-field.is-valid .ad-select,
.ad-field.is-valid .ad-textarea {
    border-color: var(--ad-accent);
}

/* Validation summary banner */
.ad-validation-summary {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--ad-radius-sm);
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.5;
}

    .ad-validation-summary.show {
        display: flex;
    }

    .ad-validation-summary svg {
        flex-shrink: 0;
        margin-top: 1px;
    }

    .ad-validation-summary strong {
        display: block;
        margin-bottom: 2px;
    }

/* Grid */
.ad-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.ad-col-12 {
    grid-column: span 12;
}

.ad-col-6 {
    grid-column: span 6;
}

.ad-col-4 {
    grid-column: span 4;
}

.ad-col-3 {
    grid-column: span 3;
}

/* Field */
.ad-field {
    display: flex;
    flex-direction: column;
}

    .ad-field label {
        font-size: 13px;
        font-weight: 500;
        color: var(--ad-text);
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .ad-field label .req {
            color: var(--ad-required);
        }

    .ad-field .helper {
        font-size: 12px;
        color: var(--ad-text-soft);
        margin-bottom: 8px;
        font-weight: 400;
    }

    .ad-field .hint {
        font-size: 12px;
        color: var(--ad-text-muted);
        margin-top: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .ad-field .hint .info-icon {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: var(--ad-text-soft);
            color: #fff;
            font-size: 10px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

/* Inputs */
.ad-input,
.ad-select,
.ad-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ad-text);
    background: #fff;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

    .ad-input::placeholder,
    .ad-textarea::placeholder {
        color: var(--ad-text-soft);
    }

    .ad-input:hover,
    .ad-select:hover,
    .ad-textarea:hover {
        border-color: var(--ad-border-strong);
    }

    .ad-input:focus,
    .ad-select:focus,
    .ad-textarea:focus {
        border-color: var(--ad-accent);
        box-shadow: 0 0 0 3px rgba(47, 99, 255, 0.12);
    }

.ad-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.ad-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}
.ad-textarea-wrap {
    position: relative;
}

.ad-textarea-counter {
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 12px;
    color: var(--ad-text-soft);
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* File upload */
.ad-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px dashed var(--ad-border-strong);
    border-radius: var(--ad-radius-sm);
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

    .ad-file:hover {
        border-color: var(--ad-accent);
        background: var(--ad-accent-soft);
    }

    .ad-file input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }
    .ad-file input[type="file"].input-validation-error {
        border-color: var(--ad-required) !important;
        background: #fef7f7;
    }
    .ad-file .file-icon {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: var(--ad-accent-soft);
        color: var(--ad-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .ad-file .file-text {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .ad-file .file-title {
        font-size: 13px;
        font-weight: 500;
        color: var(--ad-text);
    }

    .ad-file .file-meta {
        font-size: 12px;
        color: var(--ad-text-muted);
    }

    .ad-file .browse-btn {
        font-size: 12px;
        font-weight: 600;
        color: var(--ad-accent);
        padding: 6px 14px;
        border: 1px solid var(--ad-accent);
        border-radius: 6px;
        background: #fff;
        flex-shrink: 0;
    }

/* Document row */
.ad-doc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--ad-border);
}

    .ad-doc-row:last-child {
        border-bottom: none;
    }

    .ad-doc-row.single {
        grid-template-columns: 1fr;
    }

/* Form footer / actions */
.ad-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding: 20px 0;
}

.ad-btn {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
    font-family: inherit;
}

    .ad-btn:active {
        transform: translateY(1px);
    }

.ad-btn-primary {
    background: var(--ad-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 99, 255, 0.25);
}

    .ad-btn-primary:hover {
        background: var(--ad-accent-hover);
        box-shadow: 0 6px 16px rgba(47, 99, 255, 0.35);
    }

.ad-btn-secondary {
    background: #fff;
    color: var(--ad-text);
    border: 1px solid var(--ad-border-strong);
}

.ad-btn-secondary:hover {
    background: #f5f7fb;
}

.padTop0{
    padding-top:0 !important;
}

/* Bridge MVC's unobtrusive validation classes into the ad-* design system */
.ad-error.field-validation-error,
.ad-form span.field-validation-error {
    display: flex;
    font-size: 12px;
    color: var(--ad-required);
    margin-top: 6px;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

    .ad-error.field-validation-error::before,
    .ad-form span.field-validation-error::before {
        content: "";
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e63946'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm0 3a1 1 0 011 1v4a1 1 0 11-2 0V5a1 1 0 011-1zm0 8a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }
.ad-field.input-validation-error {
    background: transparent !important;
}
.ad-form .input-validation-error {
    border-color: var(--ad-required) !important;
    background: #fef7f7;
}
.ad-form .ad-select.input-validation-error {
    border-color: var(--ad-required) !important;
    background: #fef7f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 97% !important;
}
.ad-validation-summary ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

    .ad-validation-summary ul li {
        font-size: 13px;
    }

.ad-success-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--ad-radius-sm);
    color: #065f46;
    font-size: 13px;
    line-height: 1.5;
}

    .ad-success-banner svg {
        flex-shrink: 0;
        margin-top: 1px;
    }
/* Responsive */
@media (max-width: 960px) {
    .ad-col-3, .ad-col-4 {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .ad-page {
        padding: 16px 0 40px;
    }

    .ad-container {
        padding: 0 16px;
    }

    .ad-page-header h1 {
        font-size: 22px;
    }

    .ad-section-head {
        padding: 16px 18px;
        gap: 10px;
    }

    .ad-section-body {
        padding: 20px 18px;
    }

    .ad-section-head h2 {
        font-size: 15px;
    }

    .ad-col-3,
    .ad-col-4,
    .ad-col-6 {
        grid-column: span 12;
    }

    .ad-doc-row {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 0;
    }

    .ad-actions {
        flex-direction: column-reverse;
    }

    .ad-btn {
        width: 100%;
    }
}




/* ---------- Back Link ---------- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px 10px 16px;
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    border: 1px solid #e8e8e8;
    margin-bottom: 10px;
}

    /* arrow icon wrapper – this is what slides */
    .back-btn .arrow {
        display: inline-flex;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

        .back-btn .arrow svg {
            width: 16px;
            height: 16px;
            display: block;
        }

    /* ---------- Hover ---------- */
    .back-btn:hover {
        background: #ffffff;
        color: #000000;
        box-shadow: 0 6px 16px rgb(200 200 200 / 35%);
    }

        .back-btn:hover .arrow {
            transform: translateX(-5px);
        }

    /* ---------- Active (click) ---------- */
    .back-btn:active {
        transform: scale(0.97);
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    }

    /* ---------- Focus (keyboard accessibility) ---------- */
    .back-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
    }
