/**
 * eCampus Course Forms — ACROSS Brand Stylesheet
 * 
 * Shared styles for all course catalog plugin forms:
 * - Course/Event creation
 * - Student registration
 * - Schedule sections
 * 
 * Uses ACROSS theme CSS variables defined in :root.
 * Version: 1.0.0
 */

/* ==========================================================================
   PAGE WRAPPER
   ========================================================================== */

.ecampus-course-page {
    font-family: var(--font-raleway, inherit);
    color: #1b1b1f;
    background: transparent;
    padding: 32px 24px 48px;
}

.ecampus-course-page,
.ecampus-course-page *,
.ecampus-course-page *::before,
.ecampus-course-page *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   CARD CONTAINER
   ========================================================================== */

.ecampus-course-card {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    background: var(--color-white, #ffffff);
    border: 1px solid #e5e9f0;
    border-radius: var(--radius-medium, 16px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

/* No top bar — header handled by wizard-header */

/* ==========================================================================
   FORM LAYOUT
   ========================================================================== */

.ecampus-course-form {
    padding: 0 40px 36px;
    font-size: 16px;
}

.ecampus-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-european-blue, #1E5AF5);
    margin: 0 0 var(--spacing-md, 1.5rem) 0;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   TABLE LAYOUT (label — input pairs)
   ========================================================================== */

.ecampus-course-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.ecampus-course-table td {
    padding: 0;
    vertical-align: top;
}

.ecampus-course-table td:first-child {
    width: 220px;
    padding-right: 16px;
    color: #5b6570;
    font-weight: 500;
    white-space: nowrap;
}

.ecampus-course-table label {
    font-size: 16px;
    letter-spacing: 0.1px;
}

/* Required field indicator */
.ecampus-required-indicator {
    color: var(--color-red, #FF463C);
    font-weight: 700;
}

/* ==========================================================================
   FORM INPUTS
   ========================================================================== */

.ecampus-course-form input[type="text"],
.ecampus-course-form input[type="email"],
.ecampus-course-form input[type="date"],
.ecampus-course-form input[type="time"],
.ecampus-course-form input[type="datetime-local"],
.ecampus-course-form input[type="number"],
.ecampus-course-form select,
.ecampus-course-form textarea {
    width: 100%;
    max-width: 520px;
    padding: 10px 14px;
    border: 1.5px solid #dfe4ed;
    border-radius: var(--radius-small, 8px);
    background: var(--color-white, #ffffff);
    font-family: inherit;
    font-size: 16px;
    color: #1b1b1f;
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.ecampus-course-form textarea {
    min-height: 100px;
    resize: vertical;
}

.ecampus-course-form input[type="number"] {
    max-width: 120px;
}

/* Focus state — ACROSS blue ring */
.ecampus-course-form input[type="text"]:focus,
.ecampus-course-form input[type="email"]:focus,
.ecampus-course-form input[type="date"]:focus,
.ecampus-course-form input[type="time"]:focus,
.ecampus-course-form input[type="datetime-local"]:focus,
.ecampus-course-form input[type="number"]:focus,
.ecampus-course-form select:focus,
.ecampus-course-form textarea:focus {
    outline: none;
    border-color: var(--color-european-blue, #1E5AF5);
    box-shadow: 0 0 0 3px rgba(30, 90, 245, 0.15);
    background: var(--color-white, #ffffff);
}

/* Checkboxes and radios */
.ecampus-course-form input[type="checkbox"],
.ecampus-course-form input[type="radio"] {
    accent-color: var(--color-european-blue, #1E5AF5);
}

/* Inline check label (e.g. Terms & Conditions) */
.ecampus-inline-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   STACKED FIELDS & HELPERS
   ========================================================================== */

.ecampus-course-form .stacked-field {
    display: block;
}

.ecampus-course-form .stacked-field+.stacked-field {
    margin-top: 8px;
}

.ecampus-course-form .field-note {
    display: block;
    margin-top: 6px;
    color: #5b6570;
    font-size: 14px;
}

.ecampus-course-form .error {
    display: block;
    margin-top: 6px;
    color: var(--color-red, #FF463C);
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================================================
   LANGUAGE CHECKBOX GRID
   ========================================================================== */

.ecampus-language-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px 14px;
}

.ecampus-language-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1b1b1f;
    font-size: 14px;
}

/* ==========================================================================
   SUBMIT ACTIONS
   ========================================================================== */

.ecampus-course-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eef1f5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ecampus-course-actions input[type="submit"],
.ecampus-course-actions button[type="submit"] {
    border: none;
    background: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #ffffff);
    border-radius: var(--radius-small, 8px);
    padding: 12px 32px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(30, 90, 245, 0.18);
    transition: background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}

.ecampus-course-actions input[type="submit"]:hover,
.ecampus-course-actions button[type="submit"]:hover {
    background: #1549d4;
    box-shadow: 0 6px 20px rgba(30, 90, 245, 0.30);
    transform: translateY(-1px);
}

.ecampus-course-actions input[type="submit"]:active,
.ecampus-course-actions button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(30, 90, 245, 0.20);
}

/* ==========================================================================
   SCHEDULE SECTION
   ========================================================================== */

.schedule-section {
    background: var(--color-white, #fff);
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    padding: 16px 18px;
    width: 100%;
    max-width: 100%;
    transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    --schedule-label-width: 220px;
    --schedule-slot-label-width: 120px;
}

.schedule-section-wrapper {
    display: block;
    margin-left: 0;
}

.schedule-section-title {
    margin-bottom: 10px;
    color: var(--color-european-blue, #1E5AF5);
    font-weight: 700;
    font-size: 1.1rem;
}

.schedule-section:focus-within {
    background: #f8faff;
    border-color: rgba(30, 90, 245, 0.35);
    box-shadow: 0 0 0 3px rgba(30, 90, 245, 0.08);
}

/* Schedule table */
.schedule-section__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.schedule-section__table td {
    padding: 6px 8px;
    vertical-align: top;
    text-align: left !important;
}

.schedule-section__table td:first-child {
    width: var(--schedule-label-width);
    color: #222;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-section__control select,
.schedule-section__control input[type="text"],
.schedule-section__control input[type="date"],
.schedule-section__control input[type="time"] {
    width: 100%;
    max-width: 420px;
}

.schedule-section__control {
    min-width: 0;
}

/* ==========================================================================
   SCHEDULE DAYS
   ========================================================================== */

.schedule-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px 12px;
    align-items: center;
    justify-items: start;
    justify-content: start;
    width: 100%;
}

.schedule-section .schedule-day {
    display: grid !important;
    grid-template-columns: 16px auto;
    align-items: center;
    column-gap: 8px;
    white-space: nowrap;
    padding: 2px 0;
    border-radius: 6px;
    text-align: left !important;
    font-weight: 500;
    color: #1f2937;
    justify-self: start;
}

.schedule-section .schedule-day input {
    margin: 0 !important;
    float: none !important;
    order: 0;
    justify-self: start;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   SCHEDULE SLOTS
   ========================================================================== */

.schedule-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-slot {
    background: var(--color-white, #fff);
    border: 1px solid #e5e9f0;
    border-radius: var(--radius-small, 8px);
    padding: 12px 14px;
    box-shadow: none;
    text-align: left;
}

.schedule-slot--summary {
    background: #f8faff;
    border-style: dashed;
    border-color: rgba(30, 90, 245, 0.20);
}

.schedule-slot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 8px;
}

.schedule-slot__header button {
    padding: 2px 6px;
    font-size: 12px;
}

.schedule-slot__row {
    display: grid;
    grid-template-columns: var(--schedule-slot-label-width) 1fr;
    gap: 10px;
    margin-bottom: 8px;
    align-items: start;
    justify-items: start;
}

.schedule-slot__row:last-child {
    margin-bottom: 0;
}

.schedule-slot__label {
    font-size: 12px;
    color: #4a5568;
    padding-top: 6px;
    white-space: nowrap;
    font-weight: 500;
}

.schedule-slot__control {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
    justify-content: flex-start;
    justify-self: start;
}

.schedule-slot__control>* {
    align-self: flex-start;
    justify-self: start;
}

.schedule-section input[type="checkbox"],
.schedule-section input[type="time"],
.schedule-section input[type="date"],
.schedule-section input[type="text"],
.schedule-section select {
    float: none !important;
}

.schedule-section label {
    text-align: left !important;
}

.schedule-slot__control input[type="time"] {
    width: 100%;
    max-width: 240px;
    margin-left: 0 !important;
}

/* Slot summary */
.schedule-slot__summary {
    display: grid;
    grid-template-columns: var(--schedule-slot-label-width) 1fr;
    gap: 10px;
    align-items: center;
    padding: 4px 0 0;
}

.schedule-slot__summary-label {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.schedule-slot__summary-text {
    font-size: 13px;
    color: #1f2937;
}

.schedule-slot__actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.schedule-slot__helper {
    font-size: 12px;
    color: #5a667a;
}

/* Schedule buttons */
.schedule-section button {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    background: var(--color-white, #fff);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 150ms ease, border-color 150ms ease;
}

.schedule-section button:hover {
    background: #f0f4ff;
    border-color: rgba(30, 90, 245, 0.3);
}

.schedule-section button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   SCHEDULE EXCEPTIONS
   ========================================================================== */

.schedule-exceptions {
    display: grid;
    gap: 8px 12px;
    align-items: center;
    --exceptions-label-width: 40px;
    --exceptions-gap: 10px;
}

.schedule-exceptions__row {
    display: grid;
    grid-template-columns: var(--exceptions-label-width) minmax(180px, 1fr) auto;
    align-items: center;
    gap: var(--exceptions-gap);
}

.schedule-exceptions__label {
    font-size: 12px;
    color: #5a667a;
    white-space: nowrap;
}

.schedule-exceptions__action-spacer {
    width: 1px;
    height: 1px;
}

.schedule-exceptions__add {
    justify-self: start;
}

.schedule-exceptions input[type="date"] {
    width: 100%;
    max-width: 220px;
}

.schedule-exceptions__list {
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
    margin-left: calc(var(--exceptions-label-width) + var(--exceptions-gap));
}

.schedule-exceptions__item {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    background: #f0f4ff;
    border: 1px dashed rgba(30, 90, 245, 0.25);
    border-radius: var(--radius-small, 8px);
    padding: 6px 10px;
    margin-bottom: 6px;
}

/* ==========================================================================
   SCHEDULE PREVIEW
   ========================================================================== */

.schedule-preview__box {
    background: var(--color-white, #fff);
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    padding: 10px 12px;
    color: #333;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.5;
}

.schedule-section:focus-within .schedule-preview__box {
    background: #eef2ff;
    border-color: rgba(30, 90, 245, 0.3);
}

.schedule-section .error {
    display: block;
    margin-top: 4px;
    color: var(--color-red, #FF463C);
    font-size: 12px;
}

/* ==========================================================================
   OVERRIDE THEME ARTICLE HOVER ON FORM PAGES
   ========================================================================== */

article:has(.ecampus-course-page):hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .ecampus-course-page {
        padding: 24px 16px 36px;
    }

    .ecampus-course-form {
        padding: 20px;
    }

    .ecampus-course-card {
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .ecampus-course-page {
        padding: 16px 10px 28px;
    }

    .ecampus-course-form {
        padding: 16px;
    }

    .ecampus-course-table td:first-child {
        width: auto;
        padding-right: 0;
        display: block;
        margin-bottom: 6px;
    }

    .ecampus-course-table td {
        display: block;
    }

    .ecampus-course-form input[type="text"],
    .ecampus-course-form input[type="email"],
    .ecampus-course-form input[type="date"],
    .ecampus-course-form input[type="time"],
    .ecampus-course-form input[type="datetime-local"],
    .ecampus-course-form select,
    .ecampus-course-form textarea {
        max-width: 100%;
    }

    .schedule-section-wrapper {
        margin-left: 0;
    }

    .schedule-section__table td:first-child {
        width: 120px;
    }

    .schedule-days {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }

    .schedule-slot__row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   WIZARD — HEADER with ACROSS key-visual shapes
   ========================================================================== */

.wizard-header {
    position: relative;
    background: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #fff);
    padding: 36px 40px 28px;
    overflow: hidden;
    border-radius: var(--radius-medium, 16px) var(--radius-medium, 16px) 0 0;
    min-height: 120px;
}

.wizard-header__text {
    position: relative;
    z-index: 2;
    max-width: 60%;
}

.wizard-header__title {
    font-family: var(--font-raleway, inherit);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.wizard-header__subtitle {
    font-size: 0.95rem;
    opacity: 0.75;
    margin: 0;
}

/* ACROSS key-visual SVG — anchored top-right, full height */
.wizard-header__kv {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: auto;
    display: block;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 540px) {
    .wizard-header__kv { opacity: 0.4; }
    .wizard-header__text { max-width: 100%; }
}

/* ==========================================================================
   WIZARD — PROGRESS STEPPER
   ========================================================================== */

.wizard-progress {
    padding: 28px 40px 24px;
    background: var(--color-white, #fff);
}

.wizard-progress__track {
    position: relative;
    height: 3px;
    background: #e5e9f0;
    border-radius: 2px;
    margin: 0 40px;
    margin-bottom: 0;
}

.wizard-progress__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--color-european-blue, #1E5AF5);
    border-radius: 2px;
    transition: width 350ms ease;
    width: 0%;
}

.wizard-progress__steps {
    display: flex;
    justify-content: space-between;
    margin-top: -14px; /* overlap the track */
    padding: 0 28px;
}

.wizard-progress__dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: default;
    position: relative;
}

.wizard-progress__number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e9f0;
    color: #8a95a3;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e5e9f0;
    transition: background 300ms ease, border-color 300ms ease, color 300ms ease;
    font-family: var(--font-raleway, inherit);
}

.wizard-progress__label {
    font-size: 11px;
    font-weight: 600;
    color: #aab0bc;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 300ms ease;
}

/* Active step */
.wizard-progress__dot.active .wizard-progress__number {
    background: var(--color-european-blue, #1E5AF5);
    border-color: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #fff);
}

.wizard-progress__dot.active .wizard-progress__label {
    color: var(--color-european-blue, #1E5AF5);
}

/* Completed step */
.wizard-progress__dot.completed .wizard-progress__number {
    background: var(--color-european-blue, #1E5AF5);
    border-color: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #fff);
    cursor: pointer;
}

.wizard-progress__dot.completed .wizard-progress__label {
    color: var(--color-european-blue, #1E5AF5);
    opacity: 0.7;
}

/* ==========================================================================
   WIZARD — STEP PANELS
   ========================================================================== */

.wizard-step {
    display: none;
    animation: wizardFadeIn 260ms ease;
}

.wizard-step.active {
    display: block;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-step__title {
    font-family: var(--font-raleway, inherit);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-european-blue, #1E5AF5);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.wizard-step__desc {
    font-size: 0.9rem;
    color: #6b7585;
    margin: 0 0 20px;
}

/* Divider between step header and table */
.wizard-step__title + .wizard-step__desc + .ecampus-course-table,
.wizard-step__desc + .ecampus-course-table {
    border-top: 1px solid #eef1f5;
    padding-top: 16px;
}

/* ==========================================================================
   WIZARD — NAVIGATION BAR
   ========================================================================== */

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 0;
    border-top: 1px solid #eef1f5;
    margin-top: 16px;
    gap: 12px;
}

.wizard-nav__step-label {
    font-size: 13px;
    color: #8a95a3;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex: 1;
    text-align: center;
}

.wizard-nav__btn {
    border: none;
    border-radius: var(--radius-small, 8px);
    padding: 10px 24px;
    font-family: var(--font-raleway, inherit);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    letter-spacing: 0.02em;
    min-width: 100px;
}

.wizard-nav__btn--back {
    background: #f0f4ff;
    color: var(--color-european-blue, #1E5AF5);
}

.wizard-nav__btn--back:hover {
    background: #dde6ff;
}

.wizard-nav__btn--next {
    background: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #fff);
    box-shadow: 0 2px 8px rgba(30, 90, 245, 0.22);
}

.wizard-nav__btn--next:hover {
    background: #1549d4;
    box-shadow: 0 6px 18px rgba(30, 90, 245, 0.30);
    transform: translateY(-1px);
}

.wizard-nav__btn--submit {
    background: var(--color-european-blue, #1E5AF5);
    color: var(--color-white, #fff);
    box-shadow: 0 2px 8px rgba(30, 90, 245, 0.22);
}

.wizard-nav__btn--submit:hover {
    background: #1549d4;
    box-shadow: 0 6px 18px rgba(30, 90, 245, 0.30);
    transform: translateY(-1px);
}

/* ==========================================================================
   WIZARD — RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    .wizard-header {
        padding: 24px 20px 20px;
    }

    .wizard-header__title {
        font-size: 1.25rem;
    }

    .wizard-progress {
        padding: 20px 16px 0;
    }

    .wizard-progress__track {
        margin: 0 20px;
    }

    .wizard-progress__steps {
        padding: 0 8px;
    }

    .wizard-progress__label {
        display: none;
    }

    .wizard-progress__number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .wizard-nav__btn {
        min-width: 80px;
        padding: 10px 16px;
    }
}