/* End-user pages (templates/app/end_user/, layout main.tpl): the theme and custom.css as in the app;
   this file holds only what the app does not have. The header and footer of the WordPress site are in
   wordpress.css. */

/************
** LAYOUT **
************/

/* sticky footer: #wrap grows, the footer is a direct child of body */
/* the background of the WordPress pages around the white cards */
body.end-user-layout { min-height: 100vh; display: flex; flex-direction: column; background: #EBEAE6; }
body.end-user-layout #wrap { flex: 1 0 auto; }
body.end-user-layout > .dm-footer { flex-shrink: 0; }

/* page section (the title band is in wordpress.css) */
.section { padding: 30px 0; }
.section > .container > .row { --bs-gutter-x: .75rem; }


/***************************
** HOME (/home, home.tpl) **
***************************/

.nias-home-page { padding-top: 30px; padding-bottom: 60px; }
.admin-card { margin-bottom: 28px; padding: 28px 32px; background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.admin-card h2 { margin-top: 0; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid #ddd; font-weight: 400; }
.admin-card p { line-height: 1.6; }
.help-box { margin-bottom: 20px; padding: 16px 18px; background: #f5f9fc; border-left: 4px solid #2d82b7; font-size: 14px; }
.help-box.warning { border-left-color: #e5a54b; }
.help-box h4 { margin-bottom: .5rem; font-size: 1rem; font-weight: 500; }
.help-box ul { margin-bottom: 0; padding-left: 20px; }
.help-box li { margin-bottom: 6px; line-height: 1.5; }
.management-section { margin-bottom: 22px; padding: 22px; border: 1px solid #d9e6ee; border-radius: 6px; }
.management-section h3 { margin-top: 0; margin-bottom: 14px; font-size: 22px; font-weight: 400; }
.management-section p { margin-bottom: 14px; line-height: 1.6; }
.management-section ul { margin-bottom: 0; padding-left: 20px; }
.management-section li { margin-bottom: 8px; }
@media (max-width: 767px) {
    .admin-card { padding: 22px; }
    .admin-card h2 { font-size: 24px; }
    .management-section { padding: 18px; }
}


/******************************
** EDIT DOMAIN (/editdomain) **
******************************/

.domain-text-link { width: fit-content; color: var(--bs-link-color); font-weight: 500; text-decoration: none; }
.domain-text-link:hover, .domain-text-link:focus { color: var(--bs-link-hover-color); }

/* domain edit (custom.css): without the sidebar of the app the summary fits next to the form already from xl;
   inside the narrow summary the data and the actions one under another, as from xxl */
@media (min-width: 1200px) {
    .domain-edit-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        grid-template-areas: "main summary" "links summary";
        column-gap: 1.5rem;
        align-items: start;
    }
    .domain-edit-summary { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .domain-summary:has(> .domain-summary-actions) { display: block; }
    .domain-summary-actions { border-left: 0; padding-left: 0; }
}


/**********************************
** CHOOSE DOMAIN (/choosedomain) **
**********************************/

/* each holder (and each pending request) is its own box; the page script opens one at a time (is-open) */
.domain-card { border: 1px solid var(--bs-border-color); border-radius: 6px; background: #fff; transition: border-color .2s; }
.domain-card.is-open { border-color: #6ea8d8; }
.domain-card-main { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; }
/* a click anywhere on the main row selects the domain (stretched-link label); "Detalji" stays above that layer */
.domain-card-main:has(.stretched-link) { cursor: pointer; }
.domain-card-main .contact-details-toggle { position: relative; z-index: 2; }
.domain-card-side { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; }
/* on narrow screens the badge and "Detalji" take their own row: badge left, button right (as before) */
@media (max-width: 767.98px) {
    .domain-card-side { flex: 0 0 100%; justify-content: space-between; }
}
.domain-select-checkbox { width: 20px; display: inline-flex; justify-content: center; flex-shrink: 0; }
.domain-card-details { display: none; padding: .25rem 1rem 1rem; }
.domain-card.is-open .domain-card-details { display: block; }
/* a holder selected for verification: blue border and light blue background, the gray panels inside turn white (as before) */
.domain-card:has(.js-select-item:checked) { border-color: #2d82b7; background: #f4f9fd; }
.domain-card:has(.js-select-item:checked) .domain-meta-box,
.domain-card:has(.js-select-item:checked) .js-domain-row > td,
.domain-card:has(.js-select-item:checked) .domain-expanded-row > td { background: #fff; }
.domain-card.is-open .domain-card-main { border-bottom: 1px solid var(--bs-border-color); margin-bottom: .75rem; }

/* soft badges as on the portal */
.badge-subtle-success { background: #e3f4e9; color: #2f8a4f; }
.badge-subtle-danger { background: #fbe9eb; color: #c0392b; }
.badge-subtle-warning { background: #fdf1e1; color: #c27c1a; }
.badge-subtle-secondary { background: #e9ecef; color: #495057; }
.domain-card .badge { font-size: 10px; letter-spacing: .03em; font-weight: 500; }

/* "Detalji" (btn-outline-secondary): white also on a selected card, the hover of the button; the chevron turns up when open */
.contact-details-toggle { display: inline-flex; align-items: center; gap: .35rem; background-color: #fff; }
.contact-details-toggle svg, .domain-row-arrow svg { transition: transform .2s; }
.domain-card.is-open .contact-details-toggle svg, .js-domain-row.is-open .domain-row-arrow svg { transform: rotate(180deg); }

/* section titles with an icon, the key/value tables and the gray box around the holder data */
.contact-domain-list-title { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .75rem; font-weight: 500; }
.domain-meta-table td { padding: .2rem 0; vertical-align: top; }
.domain-meta-label { width: 140px; padding-right: 1rem !important; color: var(--text-muted-color); font-size: .9em; }
.domain-meta-box { width: 100%; padding: 1rem 1.5rem; background: #f8f9fa; border: 1px solid var(--bs-border-color); border-radius: 6px; border-collapse: separate; }

/* domains of a holder: a header row and a gray strip per domain that opens its details */
.contact-domain-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.contact-domain-table th { padding: 0 1rem .4rem; color: var(--text-muted-color); font-weight: 400; font-size: .9em; }
.contact-domain-table th:first-child { padding-left: 3rem; }
.js-domain-row { cursor: pointer; }
.js-domain-row > td { padding: .75rem 1rem; background: #f8f9fa; border-top: 1px solid var(--bs-border-color); }
.js-domain-row > td:first-child { border-left: 1px solid var(--bs-border-color); border-top-left-radius: 6px; }
.js-domain-row > td:last-child { border-right: 1px solid var(--bs-border-color); border-top-right-radius: 6px; }
.js-domain-row:not(.is-open) > td { border-bottom: 1px solid var(--bs-border-color); }
.js-domain-row:not(.is-open) > td:first-child { border-bottom-left-radius: 6px; }
.js-domain-row:not(.is-open) > td:last-child { border-bottom-right-radius: 6px; }
.domain-expanded-row { display: none; }
.domain-expanded-row.is-open { display: table-row; }
.domain-expanded-row > td { padding: 1rem 1.5rem 1.25rem; background: #f8f9fa; border: 1px solid var(--bs-border-color); border-top: 0; border-radius: 0 0 6px 6px; }
.contact-domain-table tbody tr.domain-expanded-row + tr.js-domain-row > td { border-top-width: 1px; }
.contact-domain-table tbody tr + tr.js-domain-row > td { box-shadow: 0 -.5rem 0 #fff; }
/* notices are smaller here than on the home, as on the old page */
.choose-domain-page .help-box, .eauthorization-page .help-box { font-size: 12px; }
/* quick actions: buttons one under another, as wide as the widest */
.domain-actions { display: inline-grid; gap: .5rem; }
.domain-actions .btn { justify-content: flex-start; }
/* below md the column takes the whole width: the buttons side by side; on a phone they do not fit, one under another over the whole width */
@media (max-width: 767.98px) {
    .domain-actions { display: flex; flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .domain-actions { display: grid; }
    .domain-actions .btn { justify-content: center; }
}
.domain-expanded-title { margin-bottom: .75rem; padding-bottom: .5rem; font-size: .95em; font-weight: 500; border-bottom: 1px solid var(--bs-border-color); }

/* domain status with a colored dot */
.domain-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #adb5bd; }
.domain-status-active::before { background: #4bbf73; }

/* registration of a new domain: the whole card is the link (stretched-link), marked as a chosen domain card on hover
   and around the whole card on keyboard focus */
.domain-choice-card { position: relative; height: 100%; padding: 1rem 1.25rem; border: 1px solid var(--bs-border-color); border-radius: 6px; background: #fff; transition: border-color .2s, background-color .2s; }
.domain-choice-card:hover { border-color: #2d82b7; background: #f4f9fd; }
.domain-choice-card:hover .domain-text-link { color: var(--bs-link-hover-color); }
.domain-choice-card .stretched-link:focus-visible { outline: none; }
.domain-choice-card:has(.stretched-link:focus-visible) { border-color: #2d82b7; box-shadow: 0 0 0 .2rem rgba(45, 130, 183, .25); }

@media (max-width: 575.98px) {
    .domain-meta-box { padding: .75rem 1rem; }
    .domain-meta-label { width: 110px; }
}


/*********************************************************************************
** INVERT THEME (e-Građani bar "Prilagodba slabovidnosti"; the class is set by  **
** js/fix-nias-toolbar.js on pages with the bar: home, choosedomain)            **
*********************************************************************************/

/* the orange border of .help-box.warning stays, on purpose */
body.invert-theme { background: #000; }
.invert-theme .admin-card { background: #fff; border: 2px solid #fff; }
.invert-theme .help-box { background: #fff; border: 1px solid #323232; border-left-width: 4px; color: #000; }
.invert-theme .help-box.warning { border-left-color: #e5a54b; }
.invert-theme .management-section { border-color: #000; }
.invert-theme .domain-text-link { color: #000; text-decoration: underline; }
.invert-theme .btn { color: #000; background: #fff; border-color: #000; }
.invert-theme .btn:hover { color: #fff; background: #000; border-color: #fff; }
.invert-theme .bVErrMsgContainer { color: #000; }
.invert-theme .card { background: #fff; border: 2px solid #fff; }
.invert-theme .bg-light { background: #fff !important; }
.invert-theme .domain-status-active::before { background: #000; }
.invert-theme .domain-card:has(.js-select-item:checked) { border-color: #000; background: #fff; }
.invert-theme .domain-choice-card:hover, .invert-theme .domain-choice-card:has(.stretched-link:focus-visible) { border-color: #000; background: #fff; box-shadow: none; }


/******************************************************
** TRANSFER (/transfer: confirmation, result, error) **
******************************************************/

/* confirmation: the current and the new registrar with an arrow on the dividing line, turned down when the
   sides are stacked; side by side the text is as far from the arrow circle as from the box edge, so the
   inner padding adds half of the circle */
.transfer-route-arrow { position: relative; border-top: 1px solid var(--bs-border-color); }
.transfer-route-arrow span { position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -50%) rotate(90deg); width: 32px; height: 32px; border: 1px solid var(--bs-border-color); border-radius: 50%; background: #fff; color: #6c757d; display: flex; align-items: center; justify-content: center; }
@media (min-width: 768px) {
    .transfer-route-arrow { border-top: 0; border-left: 1px solid var(--bs-border-color); }
    .transfer-route-arrow span { transform: translate(-50%, -50%); }
    .transfer-route-side:first-child { padding-left: 2rem !important; padding-right: calc(2rem + 16px) !important; }
    .transfer-route-side:last-child { padding-left: calc(2rem + 16px) !important; padding-right: 2rem !important; }
}

/* result: the registrar box has the same 32px text padding as on the confirmation */
.transfer-result-registrar { padding: 1rem; }
@media (min-width: 768px) {
    .transfer-result-registrar { padding: 1rem 2rem; }
}


/**********************************************************************
** E-OVLAŠTENJA (/eauthorization: the form opened from e-Ovlaštenja) **
**********************************************************************/

/* the data tables in the summary panels: bold labels, a line between rows, as on the old page */
.eauthorization-data-table th { width: 40%; font-weight: 500; }
.eauthorization-data-table th, .eauthorization-data-table td { padding: .6rem 1.25rem; vertical-align: top; }
.eauthorization-data-table tr:last-child > * { border-bottom-width: 0; }
/* the form title is larger than the titles of the panels inside it */
.eauthorization-page .col-xl-9 > .card > .card-header .card-title { font-size: 1.15rem; }
/* icons aligned to the start of a wrapping title or note sit on the middle of its first line */
.eauthorization-page .card-title svg { margin-top: 1px; }
.eauthorization-page .text-muted.d-flex svg { margin-top: 3px; }
/* the label of the domain list reads as a title of the list, as the labels in the summaries */
.eauthorization-list-label { font-weight: 500; font-size: inherit; }
@media (max-width: 575.98px) {
    .eauthorization-data-table th, .eauthorization-data-table td { display: block; width: auto; }
    .eauthorization-data-table th { padding-bottom: 0; border-bottom-width: 0; }
    /* the panels sit inside the form card, so its side padding is smaller to leave room for their text */
    .eauthorization-page .col-xl-9 > .card > .card-header,
    .eauthorization-page .col-xl-9 > .card > .card-body { padding-left: .75rem; padding-right: .75rem; }
}


/**********************************************************************************
** CHOICE CARDS (new_domain.tpl: the holder type, auth_choose_contact.tpl: the  **
** person who gets the authorisation link)                                      **
**********************************************************************************/

/* the options as white boxes with the radio button, the chosen one with a dark border; side by side while they fit,
   or one under another (.choice-cards-column) */
.choice-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-cards-column { flex-direction: column; }
.choice-card { flex: 1 1 14rem; display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; background: #fff; border: 1px solid #ced4da; border-radius: 6px; cursor: pointer; }
.choice-cards-column > .choice-card { flex: none; }
.choice-card:hover { border-color: #6c757d; }
.choice-card .form-check-input { flex: none; margin-top: .15rem; }
.choice-card .form-check-input:checked { background-color: var(--carnet-off-black-100); border-color: var(--carnet-off-black-100); }
.choice-card strong { display: block; }
.choice-card small { color: var(--text-muted-color); }
.choice-card:has(:checked) { background: #f8f9fa; border-color: var(--carnet-off-black-100); box-shadow: inset 0 0 0 1px var(--carnet-off-black-100); }
.choice-card:has(:disabled) { cursor: default; }
.choice-card:has(:disabled:not(:checked)) { opacity: .5; background: #f8f9fa; border-color: #ced4da; }


/*****************************************************
** REGISTRATION OF A FREE DOMAIN (new_domain.tpl) **
*****************************************************/

/* the own domain name is short, the field is not across the whole card */
.new-domain-name { max-width: 24rem; }

/* the introduction (register_domain_info) is paragraphs: no space under the last one in the box */
.new-domain-info > p:last-child { margin-bottom: 0; }
.new-domain-info > summary { margin-bottom: .5rem; font-weight: 600; cursor: pointer; }
.new-domain-info:not([open]) > summary { margin-bottom: 0; }

/* the two steps above the form: the active one dark, the done one with a check (.is-step-2 after "Continue") */
.new-domain-steps { display: flex; gap: 8px; margin: 0 0 1rem; padding: 0; list-style: none; }
.new-domain-steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--text-muted-color); background: #fff; border: 1px solid #e5e5e5; border-radius: 6px; }
.new-domain-step-number, .new-domain-step-done { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; font-size: 12px; font-weight: 600; color: #495057; background: #e9ecef; border-radius: 50%; }
.new-domain-step-done { display: none; color: #fff; background: var(--bs-success); }
.new-domain-steps:not(.is-step-2) .new-domain-step-1,
.new-domain-steps.is-step-2 .new-domain-step-2 { font-weight: 600; color: var(--bs-body-color); border-color: var(--carnet-off-black-100); }
.new-domain-steps:not(.is-step-2) .new-domain-step-1 .new-domain-step-number,
.new-domain-steps.is-step-2 .new-domain-step-2 .new-domain-step-number { color: #fff; background: var(--carnet-off-black-100); }
.new-domain-steps.is-step-2 .new-domain-step-1 .new-domain-step-number { display: none; }
.new-domain-steps.is-step-2 .new-domain-step-1 .new-domain-step-done { display: inline-flex; }

/* the OIB in a row of its own, half as wide, so the first and last name (and the phone and e-mail) stay in one row */
@container (min-width: 36rem) {
    .contact-fields > .new-domain-oib { grid-column: 1 / -1; width: calc(50% - .5rem); }
}

/* documents: the box files can be dropped on or clicked, the file input invisible over the whole box (it is still
   checked and the message is shown next to the box); the list of the chosen files */
.new-domain-drop { position: relative; padding: 16px; text-align: center; background: #fafafa; border: 2px dashed #ced4da; border-radius: 6px; cursor: pointer; }
.new-domain-drop:hover { border-color: var(--bs-primary); }
.new-domain-drop:focus-within { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.new-domain-drop #document { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.new-domain-drop.is-over { background: #f1f6fd; border-color: var(--bs-primary); }
.new-domain-document-list li { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px; border: 1px solid #e5e5e5; border-radius: 4px; }

/* the data from the OIB registry: a block of its own under the fields, labels left and values right */
.new-domain-registry { margin: 1.5rem 0 1rem; border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; }
.new-domain-registry-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; background: #f8f9fa; border-bottom: 1px solid #e5e5e5; }
.new-domain-registry td { padding: 8px 14px; border-color: #f0f0f0; }
.new-domain-registry td:first-child { width: 9rem; color: var(--text-muted-color); }
.new-domain-registry tr:last-child td { border-bottom: 0; }
