body.rs-profile-modal-open {
    overflow: hidden;
}

.rs-profile-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(18, 30, 38, 0.48);
    backdrop-filter: blur(2px);
}

body.rs-profile-modal-open .rs-profile-modal-backdrop {
    display: flex;
}

.rs-profile-modal {
    width: min(920px, 100%);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    border: none;
    border-radius: 14px;
    background: #e7e7e7;
    box-shadow: 0 26px 70px rgba(20, 42, 56, 0.28);
}

.rs-profile-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #0a6768;
    background: #067c7b;
    color: #ffffff;
}

.rs-profile-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.rs-profile-modal-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    opacity: 0.95;
}

.rs-profile-modal-content {
    padding: 1rem 1.25rem 0.75rem;
}

.rs-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    grid-auto-flow: row;
}

.rs-profile-card {
    border: 1px solid #d3d8dc;
    border-radius: 10px;
    padding: 0.85rem;
    background: #f1f3f4;
    grid-column: span 1;
}

.rs-profile-card h4 {
    margin: 0 0 0.75rem;
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #1c2f3d;
}

.rs-profile-field {
    width: 100%;
    min-width: 0;
    /* margin-bottom: 0.72rem; */
}

.rs-profile-field:last-child {
    margin-bottom: 0;
}

.rs-profile-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #c0c5c8, transparent);
    margin: 0.9rem 0 0.85rem;
}

.rs-profile-field label {
    /* display: block; */
    margin-bottom: 0.28rem;
    color: #223643;
    font-size: 0.84rem;
    font-weight: 600;
}

.rs-required-asterisk {
    color: #ab2d2d;
    font-weight: 700;
    margin-left: 0.15rem;
}

.rs-profile-field input,
.rs-profile-field select,
.rs-profile-field textarea {
    width: 100%;
    min-height: 36px;
    border: 1px solid #ced7dc;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.92rem;
    background: #ffffff;
}

.rs-profile-field textarea {
    min-height: 64px;
    resize: vertical;
}

.rs-readonly {
    background: #f7f7f7;
    color: #4a5965;
}

.rs-inline-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
}

.rs-secondary-btn {
    border: 1px solid #067c7b;
    border-radius: 8px;
    background: #ffffff;
    color: #067c7b;
    padding: 0.45rem 0.75rem;
    font-size: 0.86rem;
    font-weight: 600;
    min-width: 92px;
}

.rs-secondary-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.rs-gstin-status {
    min-height: 1.2rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #5f6f7b;
}

.rs-gstin-status.success {
    color: #1d7a45;
}

.rs-gstin-status.error {
    color: #ab2d2d;
}

.rs-profile-compliance {
    margin-top: 0.85rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid #d3d8dc;
    border-radius: 10px;
    background: #f1f3f4;
}

.rs-profile-terms {
    display: contents;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.rs-profile-terms input {
    width: auto;
    margin-top: 0.15rem;
}

.rs-profile-terms a {
    color: #067c7b;
    font-weight: 600;
}

.rs-profile-modal-status {
    min-height: 1.3rem;
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
}

.rs-profile-modal-status.error {
    color: #ab2d2d;
}

.rs-profile-modal-status.success {
    color: #1d7a45;
}

.rs-profile-modal-actions {
    padding: 0.35rem 1.25rem 1.2rem;
    display: flex;
    justify-content: flex-end;
}

.rs-profile-save-btn {
    min-width: 190px;
    border: 1px solid #067c7b;
    border-radius: 8px;
    background: #067c7b;
    color: #ffffff;
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.rs-profile-save-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.rs-two-col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

/* GST Category Grid Layout */
.rs-gst-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rs-gst-radio-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.rs-gst-radio-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.rs-gst-radio-label {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 8px;
    padding: 4px;
    border: 1px solid #d8dfe5;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    color: #223643;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.rs-gst-radio-label:hover {
    border-color: #067c7b;
    background-color: #f5fffe;
    box-shadow: 0 2px 8px rgba(6, 124, 123, 0.12);
}

.rs-gst-radio-input:checked + .rs-gst-radio-label {
    border-color: #067c7b;
    background-color: #eef9f8;
    box-shadow: 0 2px 10px rgba(6, 124, 123, 0.18);
}

.rs-gst-radio-input:checked + .rs-gst-radio-label .rs-radio-text {
    color: #067c7b;
    font-weight: 600;
}

.rs-radio-checkmark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    border: 2px solid #ced7dc;
    border-radius: 50%;
    background: #ffffff;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-gst-radio-input:checked + .rs-gst-radio-label .rs-radio-checkmark {
    border-color: #067c7b;
    background-color: #067c7b;
    box-shadow: inset 0 0 0 2px #ffffff;
}

.rs-gst-radio-input:checked + .rs-gst-radio-label .rs-radio-checkmark::after {
    content: "";
    position: absolute;
    display: block;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.rs-radio-text {
    color: #223643;
    transition: color 0.25s ease;
    line-height: 1.4;
    white-space: nowrap;
    overflow: visible;
}

.rs-gst-category-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid #067c7b;
    background: #eef9f8;
    border-radius: 6px;
    font-size: 0.87rem;
    color: #1a5a5a;
    font-weight: 500;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rs-gst-category-hint::before {
    content: "ℹ";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #067c7b;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* NEW: Styles for domain-matched company GSTIN section hiding */
.rs-gstin-section-hidden {
    display: none !important;
}

/* NEW: Read-only field styling for domain-matched company */
.rs-read-only-field {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
}

.rs-read-only-field:disabled {
    background-color: #f5f5f5 !important;
    color: #666 !important;
}

@media (max-width: 768px) {
    .rs-profile-modal-backdrop {
        padding: 0.75rem;
    }

    .rs-profile-modal {
        max-height: calc(100vh - 1.5rem);
    }

    .rs-profile-grid,
    .rs-two-col,
    .rs-inline-group {
        grid-template-columns: 1fr;
    }

    .rs-gst-category-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}
