/* ===================================
   REGISTRATION FORM STYLES
   Matching add-listing design pattern
   =================================== */

/* ===================================
   CONSISTENT WIDTH FOR ALL SECTIONS
   =================================== */

/* Force all direct children of space-y-8 to have same width */
.space-y-8 {
    width: 100%;
    max-width: 100%;
}

.space-y-8 > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure review sections and other containers match */
.review-section,
.review-intro,
.agreements-section,
.section-divider,
.file-upload-container,
.address-autocomplete-container,
.google-maps-preview-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Grid sections should also be full width */
.grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Form Item Component */
.form-item {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-item-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.form-item-input {
    margin-top: 0.2rem;
    width: 100%;
    max-width: 100%;
}

.form-item-desc {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Reduced spacing for form items in space-y-8 */
.space-y-8 {
    display: flex;
    flex-direction: column;
    gap: 1.25rem !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.space-y-8 > * + * {
    margin-top: 0 !important;
}

/* Ensure all direct children of space-y-8 have consistent width */
.space-y-8 > div,
.space-y-8 > section,
.space-y-8 > article,
.space-y-8 > .form-item,
.space-y-8 > .review-section,
.space-y-8 > .review-intro,
.space-y-8 > .agreements-section,
.space-y-8 > .section-divider,
.space-y-8 > .file-upload-container,
.space-y-8 > .grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Input Styles */
.registration-input {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.6rem;
    background-color: #fff;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.registration-input:focus {
    border-color: #038a52;
    box-shadow: 0 0 0 3px rgba(3, 138, 82, 0.1);
}

.registration-input.error {
    border-color: #ef4444;
}

.registration-input::placeholder {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Select Styles */
.registration-select {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    box-sizing: border-box;
}

.registration-select:focus {
    border-color: #038a52;
    box-shadow: 0 0 0 3px rgba(3, 138, 82, 0.1);
}

.registration-select.error {
    border-color: #ef4444;
}

/* Password Field */
.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.password-field-wrapper .registration-input {
    padding-right: 3rem;
    width: 100%;
    max-width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #374151;
}

/* Vendor Type Selection Cards */
.vendor-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .vendor-type-grid {
        grid-template-columns: 1fr;
    }
}

.vendor-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}

.vendor-type-card:hover {
    border-color: #038a52;
    background: #f0fdf4;
}

.vendor-type-card.selected {
    border-color: #038a52;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(3, 138, 82, 0.2);
}

.vendor-type-card .vendor-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    color: #038a52;
}

.vendor-type-card.selected .vendor-type-icon {
    background: #038a52;
    color: #fff;
}

.vendor-type-card .vendor-type-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.vendor-type-card .vendor-type-desc {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Section Divider */
.section-divider {
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.section-divider h3 {
    margin-bottom: 0.25rem;
}

.section-divider p {
    margin: 0;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

.registration-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-top: 0.125rem;
    accent-color: #038a52;
}

.registration-checkbox:checked {
    background-color: #038a52;
    border-color: #038a52;
}

/* Form Error */
.form-error {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #ef4444;
}

/* File Upload Styles */
.file-upload-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.file-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    text-align: center;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.file-upload-box:hover {
    border-color: #038a52;
    background: #f0fdf4;
}

.file-upload-box.uploaded {
    border-color: #22c55e;
    background: #f0fdf4;
    border-style: solid;
}

.file-upload-box.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.file-upload-box.uploading {
    border-color: #f59e0b;
    background: #fffbeb;
}

.file-upload-icon {
    margin-bottom: 0.75rem;
    color: #9ca3af;
}

.file-upload-box:hover .file-upload-icon {
    color: #038a52;
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.file-upload-text .file-format {
    font-size: 0.75rem;
    color: #9ca3af;
}

.file-upload-text .file-name {
    font-size: 0.75rem;
    color: #6b7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Utility: Hidden */
.hidden {
    display: none;
}

/* Utility: Animate Spin */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Review Section (Step 5) */
.review-intro {
    padding: 2rem;
    background: #f0fdf4;
    border-radius: 0.75rem;
    border: 1px solid #bbf7d0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.review-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.review-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #1f2937;
}

.review-section-header svg {
    color: #038a52;
}

.review-section-content {
    padding: 1rem 1.25rem;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.review-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    text-align: right;
}

.documents-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .documents-summary {
        grid-template-columns: 1fr;
    }
}

.doc-status {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.doc-status.uploaded {
    background: #f0fdf4;
    color: #16a34a;
}

.doc-status.missing {
    background: #fef2f2;
    color: #dc2626;
}

/* Consent Box */
.consent-box {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.consent-link {
    color: #038a52;
    text-decoration: none;
    font-weight: 500;
}

.consent-link:hover {
    text-decoration: underline;
}

/* Grid Layout Utilities */
.grid {
    display: grid;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gap-4 {
    gap: 1rem;
}

@media (max-width: 640px) {
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Space Y Utility */
.space-y-8 > * + * {
    margin-top: 2rem;
}

/* Text Utilities */
.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.font-semibold {
    font-weight: 600;
}

.text-neutral-500 {
    color: #737373;
}

.text-neutral-800 {
    color: #262626;
}

.text-green-500 {
    color: #22c55e;
}

.text-green-600 {
    color: #16a34a;
}

.text-red-500 {
    color: #ef4444;
}

.text-center {
    text-align: center;
}

/* Border Utilities */
.w-14 {
    width: 3.5rem;
}

.border-b {
    border-bottom-width: 1px;
}

.border-neutral-200 {
    border-color: #e5e5e5;
}

/* Margin Utilities */
.mb-4 {
    margin-bottom: 1rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ===================================
   MOBILE RESPONSIVENESS
   =================================== */

@media (max-width: 768px) {
    /* Full width on mobile */
    .registration-input,
    .registration-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-item-label {
        font-size: 0.8125rem;
    }

    .form-item-desc {
        font-size: 0.6875rem;
    }

    /* Vendor type cards - 1 column on mobile */
    .vendor-type-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .vendor-type-card {
        padding: 1rem 0.75rem;
        flex-direction: row;
        text-align: left;
        gap: 0.75rem;
    }

    .vendor-type-card .vendor-type-icon {
        width: 40px;
        height: 40px;
    }

    .vendor-type-card .vendor-type-name {
        font-size: 0.8125rem;
    }

    .vendor-type-card .vendor-type-desc {
        font-size: 0.6875rem;
    }

    /* Section divider */
    .section-divider {
        padding-top: 1rem;
    }

    .section-divider h3 {
        font-size: 1rem;
    }

    /* Grid layouts */
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .gap-4 {
        gap: 0.75rem;
    }

    /* Space between items */
    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }

    /* File upload box */
    .file-upload-box {
        padding: 1.5rem 1rem;
        min-height: 100px;
    }

    .file-upload-icon svg {
        width: 28px;
        height: 28px;
    }

    .file-upload-text {
        font-size: 0.8125rem;
    }

    .file-upload-text .file-format {
        font-size: 0.6875rem;
    }

    /* Review section */
    .review-intro {
        padding: 1.5rem 1rem;
    }

    .review-section-header {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .review-section-content {
        padding: 0.75rem 1rem;
    }

    .review-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .review-value {
        text-align: left;
    }

    .documents-summary {
        grid-template-columns: 1fr;
    }

    /* Checkboxes */
    .checkbox-label {
        font-size: 0.8125rem;
    }

    .consent-box {
        padding: 0.75rem;
    }

    /* Page title */
    .text-2xl {
        font-size: 1.25rem;
    }

    .text-lg {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .registration-input,
    .registration-select {
        padding: 0.625rem 0.75rem;
    }

    .vendor-type-card .vendor-type-icon {
        width: 36px;
        height: 36px;
    }

    .file-upload-box {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }
}

/* ===================================
   AGREEMENTS & CONSENT STYLES
   =================================== */

.agreements-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.agreements-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.agreements-header svg {
    color: #038a52;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.agreements-header h3 {
    margin: 0 0 0.25rem 0;
}

.agreements-header p {
    margin: 0;
}

.consent-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.consent-card:last-of-type {
    margin-bottom: 0;
}

.consent-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.consent-card-header svg {
    color: #038a52;
}

.consent-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
}

.consent-card-desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.consent-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #038a52;
    text-decoration: none;
    margin-bottom: 1rem;
    font-weight: 500;
}

.consent-card-link:hover {
    text-decoration: underline;
}

.consent-checkbox {
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.375rem;
}

.consent-checkbox span {
    font-size: 0.8rem;
    line-height: 1.4;
}

.consent-link {
    color: #038a52;
    text-decoration: none;
    font-weight: 500;
}

.consent-link:hover {
    text-decoration: underline;
}

.privacy-note {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.privacy-note p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

/* Document Preview Styles */
.documents-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.document-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.document-preview-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-preview-label {
    font-size: 0.8rem;
    color: #374151;
}

.document-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #038a52;
    background: none;
    border: 1px solid #038a52;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.document-preview-btn:hover {
    background: #038a52;
    color: #fff;
}

/* Text color helper for primary */
.text-primary {
    color: #038a52;
}
