/* EPCAN Gestattungsvertrag Plugin Styles */

.epcan-gestattung-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.epcan-gestattung-container h2 {
    margin-bottom: 10px;
    text-align: center;
    color: #122538;
}

.epcan-gestattung-container h3 {
    margin: 25px 0 15px;
}

/* === SUBTITLE === */
.epcan-gestattung-subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* === PROGRESS BAR === */
.epcan-gestattung-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.epcan-gestattung-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.epcan-gestattung-step span {
    font-size: 11px;
    color: #999;
    text-align: center;
    white-space: nowrap;
}

.epcan-gestattung-step.active span {
    color: #F1800E;
    font-weight: 600;
}

.epcan-gestattung-step.completed span {
    color: #122538;
}

.epcan-gestattung-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    background: #fff;
    transition: all 0.3s ease;
}

.epcan-gestattung-step.active .epcan-gestattung-step-circle {
    border-color: #F1800E;
    background: #F1800E;
    color: #fff;
}

.epcan-gestattung-step.completed .epcan-gestattung-step-circle {
    border-color: #122538;
    background: #122538;
    color: #fff;
}

.epcan-gestattung-step-circle svg {
    width: 14px;
    height: 14px;
}

.epcan-gestattung-step-line {
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 4px;
    margin-bottom: 24px;
    transition: background 0.3s ease;
}

.epcan-gestattung-step-line.completed {
    background: #122538;
}

/* === LOADING SCREEN === */
.epcan-gestattung-loading {
    text-align: center;
    padding: 60px 20px;
}

.epcan-gestattung-loading p {
    color: #666;
    font-size: 15px;
    margin-top: 20px;
}

.epcan-gestattung-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #ddd;
    border-top-color: #F1800E;
    border-radius: 50%;
    animation: epcan-gestattung-spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes epcan-gestattung-spin {
    to { transform: rotate(360deg); }
}

/* === ERROR SCREEN === */
.epcan-gestattung-error-screen {
    text-align: center;
    padding: 60px 20px;
}

.epcan-gestattung-error-icon {
    margin-bottom: 20px;
}

.epcan-gestattung-error-icon svg {
    width: 64px;
    height: 64px;
    color: #dc3545;
}

.epcan-gestattung-error-screen h2 {
    color: #122538;
    margin-bottom: 12px;
}

.epcan-gestattung-error-screen p {
    color: #666;
    line-height: 1.6;
}

.epcan-gestattung-error-screen a {
    color: #004D9F;
}

/* === DATA DISPLAY BOXES (Step 1) === */
.epcan-gestattung-data-box {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.epcan-gestattung-data-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin: 0 0 16px;
    font-weight: 600;
}

.epcan-gestattung-data-box h4 svg {
    color: #F1800E;
}

.epcan-gestattung-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.epcan-gestattung-data-grid--four {
    grid-template-columns: 1fr 1fr;
}

.epcan-gestattung-data-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 2px;
}

.epcan-gestattung-data-value {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #122538;
}

/* === FORM FIELDS === */
.epcan-gestattung-field {
    margin-bottom: 18px;
}

.epcan-gestattung-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.epcan-gestattung-field input[type="text"],
.epcan-gestattung-field input[type="email"],
.epcan-gestattung-field input[type="tel"],
.epcan-gestattung-field input[type="date"],
.epcan-gestattung-field select,
.epcan-gestattung-field textarea {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.epcan-gestattung-field textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

.epcan-gestattung-field input:focus,
.epcan-gestattung-field select:focus,
.epcan-gestattung-field textarea:focus {
    border-color: #004D9F;
    box-shadow: 0 0 0 3px rgba(0, 77, 159, 0.1);
    outline: none;
}

.epcan-gestattung-field input.error,
.epcan-gestattung-field select.error,
.epcan-gestattung-field textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* === ERROR MESSAGE === */
.epcan-gestattung-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 6px;
}

/* === FORM ROWS === */
.epcan-gestattung-form-row {
    display: flex;
    gap: 15px;
}

.epcan-gestattung-field--half {
    flex: 1;
}

/* === CHECKBOXES === */
.epcan-gestattung-checkbox-row {
    margin-bottom: 12px;
}

.epcan-gestattung-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
    font-size: 14px;
}

.epcan-gestattung-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.epcan-gestattung-checkbox .checkmark {
    display: inline-block;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    margin-top: 2px;
    position: relative;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: #fff;
}

.epcan-gestattung-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #004D9F;
    border-color: #004D9F;
}

.epcan-gestattung-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.epcan-gestattung-checkbox:hover .checkmark {
    border-color: #999;
}

.epcan-gestattung-checkbox a {
    color: #004D9F;
    text-decoration: underline;
}

.epcan-gestattung-checkboxes {
    margin-top: 20px;
}

/* === CONTRACT PREVIEW === */
.epcan-gestattung-contract {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 24px;
    max-height: 360px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #444;
}

.epcan-gestattung-contract h3 {
    color: #122538;
    font-size: 16px;
    margin: 0 0 16px;
    line-height: 1.4;
}

.epcan-gestattung-contract h4 {
    color: #122538;
    font-size: 14px;
    margin: 18px 0 6px;
    font-weight: 600;
}

.epcan-gestattung-contract p {
    margin: 0 0 10px;
}

/* Scrollbar styling */
.epcan-gestattung-contract::-webkit-scrollbar {
    width: 6px;
}

.epcan-gestattung-contract::-webkit-scrollbar-track {
    background: #eee;
    border-radius: 3px;
}

.epcan-gestattung-contract::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.epcan-gestattung-contract::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Contract table (Grundstück details) */
.epcan-gestattung-contract-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px;
    font-size: 14px;
}

.epcan-gestattung-contract-table td {
    padding: 6px 12px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.epcan-gestattung-contract-table td:first-child {
    font-weight: 600;
    color: #555;
    width: 160px;
    background: #f8f9fa;
}

/* === DOCUSIGN BOX === */
.epcan-gestattung-docusign-box {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-left: 4px solid #F1800E;
    border-radius: 0 8px 8px 0;
    padding: 24px;
    margin-bottom: 20px;
}

.epcan-gestattung-docusign-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #122538;
}

.epcan-gestattung-docusign-header svg {
    color: #F1800E;
    flex-shrink: 0;
}

.epcan-gestattung-docusign-header strong {
    font-size: 16px;
}

.epcan-gestattung-docusign-box p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px;
}

.epcan-gestattung-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.epcan-gestattung-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

.epcan-gestattung-badge svg {
    color: #F1800E;
}

/* === NAVIGATION BUTTONS === */
.epcan-gestattung-nav {
    display: flex;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.epcan-gestattung-nav-spacer {
    flex: 1;
}

.epcan-gestattung-btn-back {
    background: none;
    border: none;
    color: #F1800E;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
    font-family: inherit;
}

.epcan-gestattung-btn-back:hover {
    color: #d8720d;
}

.epcan-gestattung-btn-next {
    background: #F1800E;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.epcan-gestattung-btn-next:hover,
.epcan-gestattung-container .epcan-gestattung-btn-next:hover {
    background-color: #F1800E !important;
    background-image: none !important;
    color: white !important;
    opacity: 0.85;
}

.epcan-gestattung-btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.epcan-gestattung-btn-sign {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #122538;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s ease;
}

.epcan-gestattung-btn-sign:hover,
.epcan-gestattung-container .epcan-gestattung-btn-sign:hover {
    background-color: #122538 !important;
    background-image: none !important;
    color: white !important;
    opacity: 0.85;
}

.epcan-gestattung-btn-sign:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 1;
}

.epcan-gestattung-btn-sign svg {
    flex-shrink: 0;
}

/* Loading state for sign button */
.epcan-gestattung-btn-sign.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.epcan-gestattung-btn-sign.loading svg {
    visibility: hidden;
}

.epcan-gestattung-btn-sign.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: epcan-gestattung-spin 0.6s linear infinite;
}

.epcan-gestattung-container .epcan-gestattung-btn-back:hover {
    background-color: transparent !important;
    background-image: none !important;
    opacity: 0.7;
}

/* === SUCCESS MESSAGE === */
.epcan-gestattung-success {
    text-align: center;
    padding: 40px 20px;
}

.epcan-gestattung-success-icon svg {
    width: 80px;
    height: 80px;
    color: #28a745;
    margin-bottom: 20px;
}

.epcan-gestattung-success h2 {
    margin-bottom: 12px;
}

.epcan-gestattung-success > p {
    max-width: 550px;
    margin: 0 auto 30px;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.epcan-gestattung-success-details {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px 24px;
    text-align: left;
    margin-bottom: 24px;
}

.epcan-gestattung-success-details .epcan-gestattung-summary-row {
    border-bottom: 1px solid #eee;
}

.epcan-gestattung-success-details .epcan-gestattung-summary-row:last-child {
    border-bottom: none;
}

.epcan-gestattung-summary-row {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
    align-items: center;
    gap: 16px;
}

.epcan-gestattung-summary-label {
    font-weight: 600;
    color: #999;
    width: 120px;
    flex-shrink: 0;
    font-size: 13px;
}

.epcan-gestattung-summary-value {
    color: #122538;
    font-weight: 500;
}

.epcan-gestattung-contact {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

.epcan-gestattung-contact a {
    color: #004D9F;
}

/* === REQUIRED HINT === */
.epcan-gestattung-required-hint {
    text-align: right;
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .epcan-gestattung-container {
        padding: 15px;
    }

    .epcan-gestattung-progress {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    .epcan-gestattung-step {
        min-width: 60px;
    }

    .epcan-gestattung-step span {
        font-size: 9px;
    }

    .epcan-gestattung-step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .epcan-gestattung-form-row {
        flex-direction: column;
        gap: 0;
    }

    .epcan-gestattung-field--half {
        flex: none;
        width: 100%;
    }

    .epcan-gestattung-data-grid,
    .epcan-gestattung-data-grid--four {
        grid-template-columns: 1fr;
    }

    .epcan-gestattung-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .epcan-gestattung-btn-next,
    .epcan-gestattung-btn-sign {
        width: 100%;
        order: 1;
        justify-content: center;
    }

    .epcan-gestattung-btn-back {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .epcan-gestattung-nav-spacer {
        display: none;
    }

    .epcan-gestattung-badges {
        flex-direction: column;
    }

    .epcan-gestattung-success-details {
        width: 100%;
    }

    .epcan-gestattung-summary-label {
        width: 100px;
    }
}
