/*
 * Elektron Müraciət v2 — form and status pages.
 * Self-contained: only ea-* classes, no styles borrowed from other pages.
 * Layout: a white box, form on the left, result / info on the right (like the balance page).
 * Uses the site theme variables from main.css (--sectionColor, --darkCard) so dark mode keeps working.
 */

/* ---------- page ---------- */

.ea-page {
    background-color: var(--sectionColor);
    padding: 50px 0;
}

.ea-page .container {
    max-width: 1600px;
}

.ea-title {
    margin: 15px 0 30px 0;
}

/* ---------- box: left form | right result ---------- */

.ea-box {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px 5px #eaeaea;
}

.ea-box__left {
    padding: 30px 0 30px 30px;
}

.ea-box__left-inner {
    height: 100%;
    padding-right: 30px;
    border-right: 1px solid #eaeaea;
}

.ea-box__right {
    padding: 30px 30px 30px 0;
}

.ea-box__right-inner {
    padding-left: 30px;
}

.dark .ea-box {
    background-color: var(--darkCard);
    box-shadow: none;
}

.dark .ea-box__left-inner {
    border-color: #4a4f57;
}

/* ---------- fields ---------- */

.ea-field {
    margin-top: 30px;
}

/* Two related fields side by side (Ad | Soyad, Seriya | FİN, ...) */
.ea-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
}

.ea-row > .ea-field {
    min-width: 0;
}

.ea-label {
    display: block;
    margin: 0 0 5px 0;
}

.ea-field textarea {
    resize: none;
}

.ea-muted {
    color: #6c757d;
    font-size: 13px;
}

.ea-page .input-group .ea-prefix {
    flex: 0 0 80px;
}

.ea-page .input-group .ea-series {
    flex: 0 0 110px;
}

.ea-page .input-group .ea-subscriber-type {
    flex: 0 0 170px;
}

/* ---------- errors ---------- */

.ea-label--error {
    color: #d00;
}

.ea-input--error {
    border-color: #d00 !important;
}

/* Select2 sits right after the hidden <select>, which keeps the error class. */
.ea-input--error + .select2-container .select2-selection {
    border-color: #d00 !important;
}

/* ---------- Select2 (region) in the look of .form-select ---------- */
/* The dropdown is attached to <body>; Select2 is loaded on this page only. */

.ea-page .select2-container--default .select2-selection--single {
    height: 38px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat calc(100% - 12px) 50% / 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    outline: none;
}

.ea-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 6px 36px 6px 12px;
    font-size: 16px;
    line-height: 24px;
    color: #212529;
}

.ea-page .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #212529;
}

.ea-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
}

/* Block the selected topic does not use (see syncTopic in electron-application.js). */
.ea-field--disabled .ea-label {
    opacity: .5;
}

.ea-page .select2-container--disabled .select2-selection--single {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.ea-page .select2-container--disabled .select2-selection--single .select2-selection__rendered {
    color: #6c757d;
}

.select2-container--default .select2-dropdown {
    border-color: #ced4da;
    border-radius: 4px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 6px 10px;
    border-color: #ced4da;
    border-radius: 4px;
    outline: none;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 280px;
}

.select2-container--default .select2-results__group {
    padding: 8px 12px 4px;
    font-weight: 600;
    color: #0073bb;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0073bb;
}

.select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: #e7f1fa;
}

/* dark mode (body.dark) */
.dark .ea-page .select2-container--default .select2-selection--single {
    background-color: var(--darkBody);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    border-color: #4a4f57;
}

.dark .ea-page .select2-container--default .select2-selection--single .select2-selection__rendered,
.dark .ea-page .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--writeWhite);
}

.dark .ea-page .select2-container--disabled .select2-selection--single {
    opacity: .5;
}

.dark .select2-container--default .select2-dropdown {
    color: var(--writeWhite);
    background-color: var(--darkCard);
    border-color: #4a4f57;
}

.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: #4a4f57;
}

.dark .select2-container--default .select2-results__group {
    color: #7cc0ec;
}

.dark .select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: #3b4652;
}

.ea-error {
    display: block;
    margin-top: 4px;
    color: #d00;
    font-size: 12px;
}

/* ---------- buttons & links ---------- */

.ea-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 25px;
    color: #fff;
    text-decoration: none;
    background-color: #0073bb;
    border: none;
    border-radius: 5px;
    outline: none;
    transition: background-color .3s ease;
}

.ea-btn:hover {
    color: #fff;
    background-color: #00619d;
}

.ea-btn:active {
    background-color: #005080;
}

.ea-btn:disabled {
    opacity: .7;
    cursor: progress;
}

.ea-link {
    display: inline-block;
    color: #0073bb;
    text-decoration: underline;
}

/* ---------- right column: info / success / status result ---------- */

.ea-panel-title {
    font-weight: 600;
    margin-bottom: 20px;
}

.ea-steps {
    padding-left: 20px;
    margin-bottom: 20px;
}

.ea-steps li {
    margin-bottom: 8px;
}

.ea-success {
    padding-left: 16px;
    border-left: 4px solid #1e8e3e;
}

.ea-success-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ea-success .ea-btn {
    margin-top: 12px;
}

.ea-result-list {
    display: grid;
    grid-template-columns: minmax(140px, 40%) 1fr;
    gap: 12px 16px;
    margin: 0;
}

.ea-result-list dt {
    font-weight: 500;
    color: #6c757d;
}

.ea-result-list dd {
    margin: 0;
    word-break: break-word;
}

.ea-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.ea-badge--unknown {
    background: #e7f1fa;
    color: #00619d;
}

.ea-badge--rejected {
    background: #fdecea;
    color: #b3261e;
}

.ea-badge--in_progress {
    background: #fff4e0;
    color: #8a5300;
}

.ea-badge--completed {
    background: #e6f4ea;
    color: #1e7e34;
}

/* ---------- responsive ---------- */

@media (max-width: 991px) {
    .ea-box__left {
        padding: 20px 20px 0 20px;
    }

    .ea-box__left-inner {
        padding-right: 0;
        padding-bottom: 30px;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }

    .ea-box__right {
        padding: 20px;
    }

    .ea-box__right-inner {
        padding-left: 0;
    }
}

@media (max-width: 767px) {
    .ea-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .ea-page .input-group .ea-subscriber-type {
        flex-basis: 100%;
        border-radius: 5px !important;
        margin-bottom: 6px;
    }

    .ea-result-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ea-result-list dd {
        margin-bottom: 10px;
    }
}
