:root {
    --smartforms-primary-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --smartforms-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --smartforms-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --smartforms-radius: 12px;
}

#loading {
    top: 0;
    left: 0;
    padding: 0;
    margin: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 9999;
}

* {
    box-sizing: border-box;
}

form {
    display: contents;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background-color: var(--smartforms-background-color);
    padding: 20px;
    color: var(--smartforms-text-color);
    -webkit-font-smoothing: antialiased;
}

/* Common styles */

.max-width {
    width: 100%;
}

.cursor-wait:hover {
    cursor: wait;
}

.hidden {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--smartforms-transition);
}

.section-title {
    background-color: transparent;
    color: var(--smartforms-forms-section-title-text-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

.form-container {
    border: 0;
    display: flex;
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100px;
}

/* INDEX */
.form-list-box {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    border: var(--smartforms-box-border, 1px solid rgba(0,0,0,0.1));
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background-color: var(--smartforms-box-background-color);
    border-radius: var(--smartforms-radius);
    margin: 10px auto;
    transition: var(--smartforms-transition);
    cursor: pointer;
    color: var(--smartforms-box-text-color);
    box-shadow: var(--smartforms-primary-shadow);
}

.form-list-box:hover {
    background-color: var(--smartforms-box-background-color-hover);
    color: var(--smartforms-box-text-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--smartforms-card-shadow);
}

.form-image-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 20px;
    color: inherit;
    min-width: 85px;
}

.form-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.form-description {
    font-size: 1.05rem;
    opacity: 0.9;
    word-break: break-word;
}

/* SUBMISSION VIEW */
.submission-section-box {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 30px;
    border-radius: var(--smartforms-radius);
    width: 60%;
    max-width: 900px;
    margin: 20px auto;
    background-color: var(--smartforms-forms-info-background-color:);
    box-shadow: var(--smartforms-primary-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media screen and (max-width: 1300px) {
    .submission-section-box {
        width: 100%;
    }
}

.submission-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    background-color: var(--smartforms-h1-background-color);
    color: var(--smartforms-h1-color);
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    width: 100%;
}

.submission-section-box .section-title {
    background-color: inherit;
    color: var(--smartforms-forms-section-title-text-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 32px;
    padding: 0;
    text-align: center;
    line-height: 1.5;
}

.submission-instructions {
    margin-bottom: 24px;
    color: var(--smartforms-forms-info-text-color);
    line-height: 1.6;
    font-size: 1.1rem;
}

.submission-section-box .left-align {
    text-align: left;
    align-self: flex-start;
}

.submission-pdf-preview-page {
    max-width: 100%;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    box-shadow: var(--smartforms-primary-shadow);
}

.button-grid {
  display: grid;
  gap: 1.5rem;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  width: 100%;
  margin: 1rem auto;
}

.submission-action-button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  background-color: var(--smartforms-button-background-color);
  color: var(--smartforms-button-text-color);
  border: 2px solid var(--smartforms-button-border-color);
  border-radius: var(--smartforms-radius);
  transition: var(--smartforms-transition);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 24px;
  text-align: center;
  gap: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.submission-action-button:not(:disabled):hover {
  background-color: var(--smartforms-button-background-color-hover);
  border-color: var(--smartforms-button-border-color-hover);
  color: var(--smartforms-button-text-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}

.submission-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(1);
}

.submission-action-button img {
  width: 2.5rem;
  height: auto;
  flex-shrink: 0;
}

.gohome-action-button {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  background-color: var(--smartforms-button-background-color);
  color: var(--smartforms-button-text-color);
  border: 1px solid var(--smartforms-button-border-color);
  border-radius: var(--smartforms-radius);
  padding: 12px 20px;
  transition: var(--smartforms-transition);
  gap: 15px;
  box-shadow: var(--smartforms-primary-shadow);
}

.gohome-action-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--smartforms-card-shadow);
    background-color: var(--smartforms-button-background-color-hover);
    color: var(--smartforms-button-text-color-hover);
}

.gohome-action-button img {
  width: 20px;
  height: 20px;
}

.gohome-action-button p {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* FORM VIEW */

.form-view-title {
    background-color: var(--smartforms-h1-background-color);
    color: var(--smartforms-h1-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 24px;
    text-align: center;
    border-radius: var(--smartforms-radius);
    box-shadow: var(--smartforms-primary-shadow);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 90%;
    margin: 0 auto;
}

.form-view-title .index-title {
    flex: 1;
    text-align: center;
}

.form-view-title .portal-link {
    position: static;
    transform: none;
    flex-shrink: 0;
}

.form-view-title .title-spacer {
    width: 150px; /* Approximate width of the button */
    flex-shrink: 0;
}


.portal-link {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px;
    border-radius: 999px;

    border: 2px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.32);

    color: var(--smartforms-h1-color);
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(4px);

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.portal-link:hover {
    background: rgba(255, 255, 255, 0.42);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.portal-link-icon {
    font-size: 1.15rem;
    line-height: 1;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
}

.submission-nav-container {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    width: 100%;
    max-width: 900px;
    margin: 20px auto 10px;
    padding: 0 20px;
    flex-wrap: wrap;
}

.submission-nav-container .portal-link {
    position: static;
    transform: none;
    background: var(--smartforms-button-background-color);
    color: var(--smartforms-button-text-color);
    border: 1px solid rgba(40, 34, 11, 0.2);
    box-shadow: var(--smartforms-primary-shadow);
}

.submission-nav-container .portal-link:hover {
    transform: translateY(-2px);
    background: var(--smartforms-button-background-color-hover);
    color: var(--smartforms-button-text-color-hover);
}

.portal-link-icon {
    font-size: 1.1rem;
}

@media screen and (max-width: 780px) {
    .portal-link {
        border-color: rgba(255, 255, 255, 0.75);
        background: rgba(255, 255, 255, 0.40);
    }

    .portal-link-icon {
        width: 16px;
        height: 16px;
        font-size: 1.35rem;
    }

    .portal-link-text {
        display: none;
    }

    .form-view-title {
        font-size: 1.4rem;
        padding: 15px;
        gap: 10px;
    }

    /* Hide spacer on small screens */
    .form-view-title .title-spacer {
        display: none;
    }
}

.form-view-title-bar {
    display: flex;
    flex-direction: row;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: var(--smartforms-h1-background-color);
    padding: 10px 20px;
    max-width: 90%;
    margin: 0 auto;
    border-radius: var(--smartforms-radius);
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--smartforms-primary-shadow);
}

.form-view-title-bar .form-view-title {
    background-color: transparent;
    box-shadow: none;
    margin: 0;
    width: auto;
    flex: 1;
}

.form-view-title-bar .left-image,
.form-view-title-bar .right-image {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.form-section-box {
    border: var(--smartforms-forms-section-border);
    padding: 24px;
    border-radius: var(--smartforms-radius);
    background-color: var(--smartforms-forms-background-color);
    color: var(--smartforms-forms-section-title-text-color);
    max-width: 90%;
    margin: 20px auto;
    transition: var(--smartforms-transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.form-section-box:hover {
    background-color: var(--smartforms-forms-background-color-hover);
    box-shadow: var(--smartforms-primary-shadow);
}

.form-section-box .nice-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-section-box b {
    font-weight: 600;
    font-size: 1.1rem;
}

.form-section-box .section-title {
    text-align: left;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-section-box.document_content .section-title {
    text-align: center;
    font-size: 2rem;
}

select option {
    font-size: 1.1rem;
}

.simple-button {
  background-color: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: var(--smartforms-transition);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.simple-button:not(:disabled):hover {
  cursor: pointer;
  background-color: #f9f9f9;
  border-color: #ccc;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.simple-button img {
  width: 18px;
  height: 18px;
}

.info-bar {
  width: 100%;
  color: var(--smartforms-forms-info-text-color);
  border: 2px dashed var(--smartforms-button-background-color);
  padding: 20px;
  border-radius: var(--smartforms-radius);
  font-size: 1.1rem;
  margin: 24px 0;
  background-color: rgba(var(--smartforms-button-background-color-rgb, 255, 255, 255), 0.05);
}

.submit-button {
  width: 100%;
  background-color: var(--smartforms-button-background-color);
  color: var(--smartforms-button-text-color);
  border: 2px solid var(--smartforms-button-border-color);
  padding: 16px 32px;
  border-radius: var(--smartforms-radius);
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 30px;
  transition: var(--smartforms-transition);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.submit-button:hover {
  cursor: pointer;
  color: var(--smartforms-button-text-color-hover);
  background-color: var(--smartforms-button-background-color-hover);
  border-color: var(--smartforms-button-border-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Apply styles to the error container */
.error-container {
    text-align: center;
    margin: 60px auto;
    max-width: 600px;
    background-color: #fff;
    padding: 40px;
    border-radius: var(--smartforms-radius);
    box-shadow: var(--smartforms-card-shadow);
}

.error-container h1 {
    color: #dc2626;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-container p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4b5563;
}

.user-authentication-required-notice {
    color: #dc2626;
    font-size: 1.25rem;
    text-align: center;
    padding: 15px;
    font-weight: 700;
    background-color: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fee2e2;
}

.user-authentication-required {
  position: relative;
  filter: grayscale(0.5);
  pointer-events: none;
}

.user-authentication-required::after {
  content: "Vyžadováno přihlášení";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: rgba(0,0,0,0.5);
  border-radius: var(--smartforms-radius);
}

.info-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 24px;
    gap: 30px;
    background-color: rgba(255, 255, 255, 0.5);
}

.authenticated-user-info-item.text {
    flex: 1;
    min-width: 200px;
}

.authenticated-user-info-item.logout {
    text-align: right;
}

.authenticated-user-info-item.logout img {
    transition: var(--smartforms-transition);
}

.authenticated-user-info-item.logout img:hover {
    transform: rotate(15deg) scale(1.1);
}

.transparent-background {
    background-color: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.form-info {
    background-color: var(--smartforms-forms-info-background-color);
    color: var(--smartforms-forms-info-text-color);
    border-left: 5px solid var(--smartforms-button-background-color);
    padding: 24px;
}

.form-info a {
    color: var(--smartforms-forms-hyperlink-color);
    text-decoration: underline;
    font-weight: 600;
}

.form-info:hover {
    background-color: var(--smartforms-forms-info-background-color-hover);
}

.autocomplete-list {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: var(--smartforms-card-shadow);
    padding: 8px;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background-color: #f3f4f6;
}

.section-toggle {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* NICE FORMS customization */

.nice-form-group {
    --nf-input-color: var(--smartforms-forms-text-color);
    --nf-valid-input-color: var(--smartforms-forms-text-color);
    --nf-label-color: var(--smartforms-forms-label-color);
    --nf-input-background-color: var(--smartforms-input-background-color);
    --nf-invalid-input-border-bottom-color: var(--smartforms-required-field-color);
    margin-bottom: 1.5rem;
}

.nice-form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.nice-form-group input[type="text"],
.nice-form-group input[type="number"],
.nice-form-group input[type="email"],
.nice-form-group input[type="tel"],
.nice-form-group input[type="search"],
.nice-form-group select,
.nice-form-group textarea {
    border-radius: 6px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    transition: var(--smartforms-transition);
}

.nice-form-group input[type="text"]:focus,
.nice-form-group input[type="number"]:focus,
.nice-form-group input[type="email"]:focus,
.nice-form-group input[type="tel"]:focus,
.nice-form-group input[type="search"]:focus,
.nice-form-group select:focus,
.nice-form-group textarea:focus {
    border-color: var(--smartforms-input-focus-border-color);
    box-shadow: 0 0 0 3px rgba(var(--smartforms-input-focus-border-color-rgb, 59, 130, 246), 0.1);
    outline: none;
}

.nice-form-group input:required:not([readonly]) {
    border-bottom-width: 3px;
    border-bottom-color: var(--smartforms-required-field-color);
}

.nice-form-group textarea:required:not([readonly]) {
    border-bottom-width: 3px;
    border-bottom-color: var(--smartforms-required-field-color);
}

.nice-form-group select:required:not([readonly]) {
    border-bottom-width: 3px;
    border-bottom-color: var(--smartforms-required-field-color);
}

.nice-form-group input[type="checkbox"]:not(.switch) {
    width: 2.0rem;
    height: 2.0rem;
    border-radius: 4px;
    cursor: pointer;
}

.document_content {
    background: inherit;
    white-space: normal;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* PAYMENTS */
.payment-details {
    padding: 24px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px 40px;
    align-items: start;
    border: 1px solid #e5e7eb;
    border-radius: var(--smartforms-radius);
    background-color: #f9fafb;
}

.payment-details .label {
    font-weight: 700;
    color: #374151;
}

.payment-details .value {
    color: #111827;
}

.payment-details .total-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
    font-size: 1.25rem;
}

