.heritage-company-portal-wrapper, .heritage-investor-portal-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    font-family: var(--heritage-font-family, Arial, sans-serif);
    font-size: var(--heritage-font-size, 13px);
    line-height: var(--heritage-line-height, 1.35);
    font-weight: var(--heritage-font-weight, 400);
}

.heritage-company-portal-wrapper h1,
.heritage-company-portal-wrapper h2,
.heritage-company-portal-wrapper h3,
.heritage-company-portal-wrapper h4,
.heritage-investor-portal-wrapper h1,
.heritage-investor-portal-wrapper h2,
.heritage-investor-portal-wrapper h3,
.heritage-investor-portal-wrapper h4 {
    font-size: var(--heritage-heading-font-size, 1.2em);
    line-height: var(--heritage-heading-line-height, 1.2);
    font-weight: var(--heritage-heading-font-weight, 600);
}

.heritage-company-portal-wrapper p,
.heritage-investor-portal-wrapper p {
    font-size: var(--heritage-paragraph-font-size, 1em);
    line-height: var(--heritage-paragraph-line-height, 1.35);
    font-weight: var(--heritage-paragraph-font-weight, 400);
}

/* Tabs */
.portal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.portal-tabs .tab-link {
    background-color: inherit;
    float: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: var(--heritage-tab-font-size, 1.05em);
    line-height: var(--heritage-tab-line-height, 1.2);
    font-weight: var(--heritage-tab-font-weight, 600);
    flex: 0 0 auto;
}

.portal-tabs .tab-link:hover {
    background-color: #ddd;
}

.portal-tabs .tab-link.active {
    background-color: rgb(21,60,34);
    color: white;
}

.tab-content {
    animation: fadeEffect 1s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Instruction Box */
.instruction-box {
    background: #f9f9f9;
    border-left: 5px solid rgb(21,60,34);
    padding: 15px;
    margin-bottom: 20px;
}

.submission-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin: 0 0 14px 0;
}
.submission-choice label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
}
.submission-choice input[type="radio"] {
    margin: 0;
}

.deck-dropzone {
    border: 2px dashed #c7c7c7;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    user-select: none;
    margin-bottom: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.deck-dropzone-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}
.deck-dropzone-subtitle {
    color: #666;
    font-size: 0.95em;
}
.deck-dropzone.is-dragover {
    background: #f2f6f3;
    border-color: rgb(21,60,34);
}
.deck-dropzone.has-file {
    border-color: rgb(21,60,34);
    background: #f6faf7;
}

/* Form Layout */
.form-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.form-column {
    flex: 1;
    min-width: 260px;
    background: #fff;
    padding: 18px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.form-column h3 {
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 14px;
    color: #333;
}

/* Form Elements */
.heritage-company-portal-wrapper label,
.heritage-investor-portal-wrapper label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: var(--heritage-label-font-size, 0.95em);
    line-height: var(--heritage-label-line-height, 1.25);
    font-weight: var(--heritage-label-font-weight, 600);
}

.heritage-company-portal-wrapper input[type="text"],
.heritage-company-portal-wrapper input[type="email"],
.heritage-company-portal-wrapper input[type="number"],
.heritage-company-portal-wrapper input[type="password"],
.heritage-company-portal-wrapper select,
.heritage-company-portal-wrapper textarea,
.heritage-investor-portal-wrapper input[type="text"],
.heritage-investor-portal-wrapper input[type="email"],
.heritage-investor-portal-wrapper input[type="number"],
.heritage-investor-portal-wrapper input[type="password"],
.heritage-investor-portal-wrapper select,
.heritage-investor-portal-wrapper textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    font-size: var(--heritage-input-font-size, 1em);
    line-height: var(--heritage-input-line-height, 1.35);
    font-weight: var(--heritage-input-font-weight, 400);
    background: #fff;
}

.heritage-company-portal-wrapper textarea,
.heritage-investor-portal-wrapper textarea {
    height: 80px;
    resize: vertical;
}

.heritage-company-portal-wrapper input[type="text"]:focus,
.heritage-company-portal-wrapper input[type="email"]:focus,
.heritage-company-portal-wrapper input[type="number"]:focus,
.heritage-company-portal-wrapper input[type="password"]:focus,
.heritage-company-portal-wrapper select:focus,
.heritage-company-portal-wrapper textarea:focus,
.heritage-investor-portal-wrapper input[type="text"]:focus,
.heritage-investor-portal-wrapper input[type="email"]:focus,
.heritage-investor-portal-wrapper input[type="number"]:focus,
.heritage-investor-portal-wrapper input[type="password"]:focus,
.heritage-investor-portal-wrapper select:focus,
.heritage-investor-portal-wrapper textarea:focus {
    outline: none;
    border-color: rgb(21,60,34);
    box-shadow: 0 0 0 2px rgba(21,60,34,0.12);
}

.field-help {
    margin-top: -10px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.95em;
}

.heritage-company-portal-wrapper hr,
.heritage-investor-portal-wrapper hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 14px 0;
}

/* Checkbox Groups */
.checkbox-group {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px 14px;
}
.checkbox-group label {
    font-weight: normal;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0;
}
.checkbox-group label input[type="checkbox"] {
    margin-top: 2px;
    margin-right: 0;
}

.heritage-company-portal-wrapper label input[type="checkbox"],
.heritage-investor-portal-wrapper label input[type="checkbox"] {
    margin-right: 8px;
}

/* Collateral Items */
.collateral-item {
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.collateral-item input[type="text"] {
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 0.9em;
}

/* Actions */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

#submit-company-form, #submit-investor-step1, #submit-investor-step2, #upload-btn, .button {
    background-color: rgb(21,60,34);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--heritage-button-font-size, 1em);
    line-height: var(--heritage-button-line-height, 1.2);
    font-weight: var(--heritage-button-font-weight, 600);
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
}

#submit-company-form:hover, #submit-investor-step1:hover, #submit-investor-step2:hover, #upload-btn:hover, .button:hover {
    background-color: black;
}

#form-message, #step1-message, #step2-message, #upload-message {
    margin-top: 15px;
    font-weight: bold;
}
.success-message { color: green; }
.error-message { color: red; }

/* Dashboard Styles */
.investor-dashboard {
    background: #f4f4f4;
    padding: 20px;
    border-radius: 5px;
}
.dashboard-section {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 1em;
}
.opportunity-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.opp-card {
    flex: 1;
    min-width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.stat-box {
    background: #f9f9f9;
    padding: 15px;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 4px;
}
.stat-box strong {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.stat-box span {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: rgb(21,60,34);
}
.deal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.deal-table th, .deal-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.deal-table th {
    background: #f5f5f5;
    font-weight: bold;
}

@media (max-width: 600px) {
    .portal-tabs .tab-link {
        font-size: 1em;
        padding: 10px 12px;
    }

    .form-columns {
        gap: 12px;
    }

    .form-column {
        min-width: 0;
        flex: 1 1 100%;
        padding: 14px;
    }

    .investor-dashboard {
        padding: 14px;
    }

    .dashboard-section {
        padding: 14px;
    }

    .opportunity-grid {
        gap: 12px;
    }

    .opp-card {
        min-width: 0;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-box span {
        font-size: 1.2em;
    }

    #submit-company-form, #submit-investor-step1, #submit-investor-step2, #upload-btn, .button {
        width: 100%;
        padding: 10px 14px;
        font-size: 1em;
    }

    .deal-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .deal-table th, .deal-table td {
        white-space: nowrap;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .deck-dropzone {
        padding: 14px;
    }
}

@media (max-width: 360px) {
    .heritage-company-portal-wrapper, .heritage-investor-portal-wrapper {
        padding: 8px;
    }

    .portal-tabs {
        gap: 6px;
        margin-bottom: 14px;
    }

    .portal-tabs .tab-link {
        font-size: 0.95em;
        padding: 9px 10px;
    }

    .instruction-box {
        padding: 12px;
    }

    .form-column {
        padding: 12px;
    }

    .heritage-company-portal-wrapper input[type="text"],
    .heritage-company-portal-wrapper input[type="email"],
    .heritage-company-portal-wrapper input[type="number"],
    .heritage-company-portal-wrapper input[type="password"],
    .heritage-company-portal-wrapper select,
    .heritage-company-portal-wrapper textarea,
    .heritage-investor-portal-wrapper input[type="text"],
    .heritage-investor-portal-wrapper input[type="email"],
    .heritage-investor-portal-wrapper input[type="number"],
    .heritage-investor-portal-wrapper input[type="password"],
    .heritage-investor-portal-wrapper select,
    .heritage-investor-portal-wrapper textarea {
        padding: 7px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
