/* ========================================
   Part D: Center Column - Form Styles
   ======================================== */

.apply-form-section {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.apply-form-section fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* ---- Organization Type Cards (Store-style) ---- */
.org-type-selection-step {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.org-step-title {
    font-size: 1.3rem;
    color: #343a40;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.org-step-title i {
    color: var(--logoBlue, #086AB0);
}

.org-step-subtitle {
    color: #6c757d;
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
}

.org-type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 100%;
}

.org-type-card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-family: inherit;
    font-size: inherit;
}

.org-type-card:hover {
    border-color: var(--logoBlue, #086AB0);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(8, 106, 176, 0.15);
}

.org-type-card:active {
    transform: translateY(-1px);
}

.org-type-card.selected {
    border-color: var(--logoBlue, #086AB0);
    background: #f0f7ff;
    box-shadow: 0 4px 20px rgba(8, 106, 176, 0.2);
}

.org-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8f4fc, #d0e8f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--logoBlue, #086AB0);
}

.org-type-card h4 {
    font-size: 1.05rem;
    color: #343a40;
    margin: 0;
}

.org-type-card p {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    max-width: none;
}

/* ---- Selected Org Badge ---- */
.selected-org-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #e8f4fc, #f0f8ff);
    border: 2px solid var(--logoBlue, #086AB0);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.selected-org-badge span {
    font-weight: 600;
    color: var(--logoBlue, #086AB0);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.change-org-btn {
    background: transparent;
    border: 1px solid var(--logoBlue, #086AB0);
    color: var(--logoBlue, #086AB0);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.change-org-btn:hover {
    background: var(--logoBlue, #086AB0);
    color: white;
}

/* ---- Form Section Titles ---- */
.form-section-title {
    margin: 0 0 1rem 0;
    color: var(--logoBlue, #086AB0);
    font-size: 1.15rem;
    border-bottom: 2px solid var(--logoBlue, #086AB0);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title-green {
    color: #28a745;
    border-bottom-color: #28a745;
}

.form-section-title-warning {
    color: #856404;
    border-bottom-color: #ffc107;
}

.form-section-title-danger {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

/* ---- Form Organization Sections ---- */
.form-org-section {
    margin: 1rem 0;
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid var(--logoBlue, #086AB0);
    border-radius: 12px;
}

#contactInfoSection {
    border-color: #28a745;
}

/* ---- Form Notices ---- */
.form-notice {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-notice p {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    text-align: left;
    max-width: none;
}

.form-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.form-notice-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1565c0;
}

.form-notice-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ---- Form Fields ---- */
.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #343a40;
    font-size: 0.95rem;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--logoBlue, #086AB0);
    box-shadow: 0 0 0 3px rgba(8, 106, 176, 0.1);
    outline: none;
}

.form-field-help {
    display: block;
    margin-top: 0.35rem;
    color: #666;
    font-size: 0.82rem;
    font-style: italic;
}

.form-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ---- Address Group ---- */
.form-address-group {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.form-address-title {
    margin: 0 0 0.75rem 0;
    color: var(--logoBlue, #086AB0);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Required Asterisk ---- */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* ---- OS Section ---- */
.form-os-section {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid #ffc107;
    border-radius: 12px;
}

.operatingSystem {
    margin-top: 0.75rem;
}

.os-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.os-option:hover {
    background: #e9ecef;
}

.os-option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--logoBlue, #086AB0);
    cursor: pointer;
}

.os-option label {
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.windowsNotice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    color: #856404;
    font-weight: 600;
    display: none;
}

.linuxTypeDiv {
    margin: 0.75rem 0 0.75rem 2rem;
}

.linuxTypeDiv label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.linuxTypeDiv select {
    width: 100%;
    max-width: 300px;
    padding: 0.65rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

/* ---- Device Requirements ---- */
.device-requirements-section {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid #dc3545;
    border-radius: 12px;
}

.device-limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.device-limit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.88rem;
}

.device-limit-item span:first-child {
    font-weight: 500;
}

.device-limit-max {
    color: #1976d2;
    font-weight: 600;
}

.device-section-error {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.doYouNeed {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
    margin-top: 0.75rem;
}

.doYouNeed .device-row {
    display: block !important;
    margin-bottom: 0.5rem;
    padding: 0;
    border-radius: 6px;
    border: none !important;
}

.doYouNeed .device-row-main {
    display: flex !important;
    align-items: center;
    padding: 0.5rem;
    border: 2px solid #e9ecef !important;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.doYouNeed .device-row-main:hover {
    background: #e9ecef;
}

/* Prevent global .doYouNeed div rules from breaking OS split layout */
.doYouNeed .os-split-panel {
    display: block !important;
    border: 1px solid #c8ddf0 !important;
    border-top: 3px solid var(--logoBlue, #086AB0) !important;
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .os-split-panel:hover {
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .os-split-panel div {
    display: block;
    border: none !important;
    margin: 0;
    padding: 0;
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .os-split-panel div:hover {
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .os-split-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.doYouNeed .os-split-field {
    display: flex !important;
    flex-direction: column;
    gap: 0.25rem;
}

.doYouNeed .os-split-header {
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Tier split panel overrides (same treatment as OS split) */
.doYouNeed .tier-split-panel {
    display: block !important;
    border: 1px solid #d4e8d4 !important;
    border-top: 3px solid var(--logoCyan, #2ebfa5) !important;
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .tier-split-panel:hover {
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .tier-split-panel div {
    display: block;
    border: none !important;
    margin: 0;
    padding: 0;
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .tier-split-panel div:hover {
    transform: none !important;
    box-shadow: none !important;
}

.doYouNeed .tier-split-panel .os-split-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.doYouNeed .tier-out-of-stock {
    background: #dc3545;
    color: white !important;
    font-size: 1rem;
    font-weight: 900;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doYouNeed .tier-split-panel .os-split-field {
    display: flex !important;
    flex-direction: column;
    gap: 0.25rem;
}

.doYouNeed .tier-split-panel .os-split-header {
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.doYouNeed input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--logoBlue, #086AB0);
    margin-right: 0.75rem;
    cursor: pointer;
}

.doYouNeed label {
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    margin: 0;
}

.doYouNeed .device-row-main > input[type="number"] {
    padding: 0.45rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-weight: 600;
    max-width: 90px;
    text-align: center;
    font-family: inherit;
}

.doYouNeed .device-row-main > input[type="number"]:focus {
    border-color: var(--logoBlue, #086AB0);
    box-shadow: 0 0 0 3px rgba(8, 106, 176, 0.1);
    outline: none;
}

.selectionNotice {
    display: none !important;
}

#monitorDesktopError {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.75rem;
    padding: 0.65rem;
    background: #fff5f5;
    border: 2px solid #f5c6cb;
    border-radius: 4px;
}

#monitorDesktopError i {
    margin-right: 0.5rem;
}

/* ---- Comments ---- */
.form-comments-section {
    margin: 1.25rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.form-comments-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-comment-wrapper {
    position: relative;
}

.form-comment-wrapper textarea {
    width: 100%;
    padding: 0.65rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
}

.form-comment-wrapper textarea:focus {
    border-color: var(--logoBlue, #086AB0);
    box-shadow: 0 0 0 3px rgba(8, 106, 176, 0.1);
    outline: none;
}

.textCounter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.78rem;
    color: var(--logoBlue, #086AB0);
    font-weight: 600;
    pointer-events: none;
}

/* ---- Agreement ---- */
.form-agreement-section {
    margin: 1.25rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.acfs-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.acfs-checkbox-container input[type="checkbox"] {
    margin-top: 0.2rem;
    transform: scale(1.2);
    accent-color: var(--logoBlue, #086AB0);
}

.acfs-checkbox-container label {
    margin: 0;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.acfs-checkbox-container p {
    margin: 0.4rem 0 0 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    text-align: left;
    max-width: none;
}

.acfs-checkbox-container a {
    color: var(--logoBlue, #086AB0);
    text-decoration: underline;
}

/* ---- reCAPTCHA ---- */
.form-recaptcha-section {
    margin: 1.25rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Submit Button ---- */
.form-submit-section {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}

.submit-btn {
    background: linear-gradient(135deg, var(--logoBlue, #086AB0), #0056b3);
    color: white;
    border: none;
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(8, 106, 176, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 106, 176, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(8, 106, 176, 0.3);
}

/* ---- Error Styling ---- */
.field-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 600;
    display: block;
}

input.error, select.error, textarea.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: #fff5f5 !important;
}

input.valid, select.valid, textarea.valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* ---- Loading Spinner ---- */
.loading {
    text-align: center;
    margin: 1rem 0;
    font-size: 2rem;
    color: var(--logoBlue, #086AB0);
}

.loading.hidden {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .apply-form-section {
        padding: 1rem;
    }

    .org-type-cards {
        grid-template-columns: 1fr;
    }

    .form-field-row {
        grid-template-columns: 1fr;
    }

    .device-limits-grid {
        grid-template-columns: 1fr;
    }

    .form-org-section {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .org-step-title {
        font-size: 1.1rem;
    }

    .org-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .submit-btn {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }
}

/* ---- Per-Device OS Split Panels ---- */
/* ---- Tier Split Panels ---- */
.tier-split-panel {
    background: linear-gradient(135deg, #f0fff4, #f8f9fa);
    border: 1px solid #d4e8d4;
    border-top: 3px solid var(--logoCyan, #2ebfa5);
    border-radius: 0 0 8px 8px;
    padding: 0.75rem;
    margin: 0.25rem 0 0.5rem 0;
    box-sizing: border-box;
    overflow: hidden;
}

.tier-split-panel .os-split-header i {
    color: var(--logoCyan, #2ebfa5);
}

.tier-split-panel .os-split-fields {
    grid-template-columns: 1fr 1fr;
}

.tier-split-input {
    width: 100%;
    padding: 0.35rem 0.25rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.85rem;
    text-align: center;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tier-split-input:focus {
    border-color: var(--logoCyan, #2ebfa5);
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 191, 165, 0.15);
}

.os-split-panel {
    background: linear-gradient(135deg, #f0f7ff, #f8f9fa);
    border: 1px solid #c8ddf0;
    border-top: 3px solid var(--logoBlue, #086AB0);
    border-radius: 0 0 8px 8px;
    padding: 0.75rem;
    margin: 0.25rem 0 0.5rem 0;
    box-sizing: border-box;
    overflow: hidden;
}

.os-split-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.os-split-header i {
    color: var(--logoBlue, #086AB0);
    font-size: 0.85rem;
}

.os-split-total {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    white-space: nowrap;
}

.os-split-total.valid {
    background: #d4edda;
    color: #155724;
}

.os-split-total.invalid {
    background: #f8d7da;
    color: #721c24;
}

.os-split-note {
    font-size: 0.78rem;
    color: #495057;
    background: #e8f4fc;
    border-radius: 5px;
    padding: 0.45rem 0.6rem;
    margin: 0 0 0.6rem 0;
    line-height: 1.45;
    max-width: none;
}

.os-split-note i {
    color: var(--logoBlue, #086AB0);
    margin-right: 0.2rem;
}

.os-split-note strong {
    color: var(--logoBlue, #086AB0);
}

.os-split-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.os-split-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.os-split-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    margin: 0;
}

.os-split-field label i {
    font-size: 0.75rem;
}

.os-split-field label .fab.fa-windows {
    color: #0078d4;
}

.os-split-field label .fab.fa-linux {
    color: #e95420;
}

.os-split-field label .fas.fa-ban {
    color: #adb5bd;
}

.os-split-input {
    width: 100%;
    padding: 0.35rem 0.25rem;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.85rem;
    text-align: center;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.os-split-input:focus {
    border-color: var(--logoBlue, #086AB0);
    outline: none;
    box-shadow: 0 0 0 2px rgba(8, 106, 176, 0.12);
}

.os-split-input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
    color: #6c757d;
    border-color: #dee2e6;
}

.os-split-error {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: 500;
}

/* Linux type global selector */
.linux-type-global select {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .os-split-fields {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .os-split-panel {
        margin-left: 0;
    }
}
