/* UNPR Registration Form Styles */

/* 🎨 CSS Variables */
:root {
    --porto-primary-color: #dd693e;
    --porto-primary-dark: #c55a2f;
    --porto-text-color: #333;
    --porto-border-color: #d0d0d0;
    --porto-bg-light: #f9f9f9;
    --porto-focus-shadow: rgba(221, 105, 62, 0.1);
}

.unpr-registration-form-container {
    max-width: 100%;
    width: 100%;
    padding: 15px;
    margin: 30px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #dd693e;
    font-size: 18px;
    margin-bottom: 20px;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #dd693e;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #dd693e;
    box-shadow: 0 0 0 3px var(--porto-focus-shadow);
}

.form-group input:readonly {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-group p {
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 12px;
    color: #666;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.input-group .button {
    padding: 12px 20px;
    height: auto;
    white-space: nowrap;
}

.button {
    padding: 10px 20px;
    background-color: #dd693e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.button:hover {
    background-color: var(--porto-primary-dark);
}

.button-primary {
    background-color: #dd693e;
}

.button-primary:hover {
    background-color: var(--porto-primary-dark);
}

.button-large {
    padding: 15px 40px;
    font-size: 16px;
    width: 100%;
}

#company-fetch-status,
#file-upload-status {
    margin-top: 10px;
}

#company-fetch-status p,
#file-upload-status p {
    margin: 0;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

#form-message {
    margin-top: 20px;
}

#form-message p {
    margin: 0;
}

/* Modal CAEN */
.unpr-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.unpr-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.unpr-modal-close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.unpr-modal-close:hover {
    color: #333;
}

.unpr-modal-content h2 {
    margin-top: 0;
    color: #dd693e;
    font-size: 20px;
}

.caen-search {
    margin-bottom: 20px;
}

.caen-search input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.caen-search input:focus {
    outline: none;
    border-color: #dd693e;
    box-shadow: 0 0 0 3px var(--porto-focus-shadow);
}

.caen-list {
    max-height: 400px;
    overflow-y: auto;
}

.caen-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.caen-item:hover {
    background: #ffe8d6;
    border-color: #dd693e;
    transform: translateX(5px);
}

.caen-item strong {
    color: #dd693e;
    font-weight: 600;
}

/* Extra small phones - 320px+ (Oppo, Huawei, etc) */
@media (max-width: 480px) {
    .unpr-registration-form-container {
        max-width: 100%;
        width: 100%;
        padding: 12px;
        margin: 15px auto;
    }

    .form-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .form-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid var(--porto-primary-color);
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
        font-weight: 600;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="url"],
    .form-group input[type="file"] {
        width: 100%;
        padding: 10px;
        font-size: 13px;
        border: 1px solid var(--porto-border-color);
        box-sizing: border-box;
    }

    .button {
        padding: 8px 15px;
        font-size: 13px;
        background-color: var(--porto-primary-color);
    }

    .button:hover {
        background-color: var(--porto-primary-dark);
    }

    .button-large {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }

    .input-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .input-group input {
        width: 100%;
    }

    .input-group .button {
        width: 100%;
        padding: 10px 15px;
    }

    .unpr-modal {
        z-index: 1000;
    }

    .unpr-modal-content {
        width: 95%;
        max-width: 100%;
        padding: 15px;
        margin: 40% auto;
        max-height: 80vh;
    }

    .unpr-modal-content h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .caen-search input {
        font-size: 13px;
        padding: 10px;
    }

    .caen-item {
        padding: 10px;
        margin-bottom: 6px;
        font-size: 13px;
    }

    .caen-item strong {
        color: var(--porto-primary-color);
    }
}

/* Small tablets - 600px+ */
@media (min-width: 481px) and (max-width: 768px) {
    .unpr-registration-form-container {
        max-width: 95%;
        padding: 15px;
    }
}

/* Tablets și desktop - 769px+ */
@media (min-width: 769px) {
    .unpr-registration-form-container {
        max-width: 800px;
        padding: 30px;
    }
}


/* Loading states */
.loading {
    text-align: center;
    padding: 20px;
    color: #dd693e;
    font-style: italic;
}

/* Status messages */
.notice {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: 4px;
}

.notice-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.notice-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.notice p {
    margin: 0;
}


/* 🟢 FIX: selectorul original tinta #unpr-registration-form-container si
   #unpr-registration-form, dar wrapper-ul real din form.php are id
   "unpr-form-wrapper" - regula nu se aplica niciodata pe el.
   Adaugam si selectorul corect, cu specificitate mare, ca sa invingem
   orice regula de tip "hide on mobile" venita din temă/page builder
   (Elementor/WPBakery/Porto responsive visibility). */
html body #unpr-form-wrapper,
html body #unpr-registration-form,
.unpr-registration-form-container,
#unpr-registration-form {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}


.company-loading {
    color: #dd693e;
    font-weight: 600;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: .4; }
    50% { opacity: 1; }
    100% { opacity: .4; }
}
