﻿
.form {
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 800px !important;
    max-height: 50vh !important;
    padding: 20px;
    font-family: system-ui;
    text-align: center;
}

.form .details-container {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 10px;
    align-content: center;
}

.form-item-1 {
    grid-column-start: 1;
    grid-column-end: 3;
}

.form .details-header {
    display: grid;
    grid-template-columns: auto;
    justify-content: left;
}

.form-head {
    position: relative;
    margin-bottom: 15px
}

.form-item {
    position: relative;
    margin-bottom: 15px
}

.form-item input {
    display: block;
    width: 100%;
    height: 30px;
    background: transparent;
    border: solid 1px #ccc;
    transition: all .2s ease;
    padding: 0 15px;
    border-radius: 4px;
}

.form-item-2 {
    grid-column-start: 1;
    grid-column-end: 3;
}

.form-item label {
    position: absolute;
    cursor: text;
    z-index: 2;
    top: 11px;
    left: 10px;
    font-size: 12px;
    font-weight: bold;
    background: #fff;
    padding: 0 3px;
    color: #999;
    transition: all .2s ease
}

.form-item-1 .form-item label,
.form-item-unit .form-item label {
    cursor: text;
    z-index: 2;
    top: 11px;
    left: 10px;
    font-size: 12px;
    font-weight: bold;
    background: #fff;
    padding: 0 3px;
    color: #999;
    transition: all .2s ease;
    top: -8px;
}

.form-item-1 .form-item select,
.form-item-unit .form-item select {
    display: block;
    width: 100%;
    height: 30px;
    background: transparent;
    border: solid 1px #ccc;
    transition: all .2s ease;
    padding: 0 15px;
    border-radius: 4px;
    font-size: 12px;
}

.form-item input:focus + label,
.form-item input:not(:placeholder-shown) + label {
    font-size: 11px;
    top: 0;
    color: #0078d4;
}

.form-item input:focus {
    border-color: #0078d4;
}

.form-item-CRDR .form-item label {
    cursor: text;
    z-index: 2;
    top: 11px;
    left: 10px;
    font-size: 12px;
    font-weight: bold;
    background: #fff;
    padding: 0 3px;
    color: #999;
    transition: all .2s ease;
    top: -8px;
}

.form-item-CRDR .form-item select {
    display: block;
    width: 100%;
    height: 30px;
    background: transparent;
    border: solid 1px #ccc;
    transition: all .2s ease;
    padding: 0 15px;
    border-radius: 4px;
}

.form-item-yesno label {
    cursor: text;
    z-index: 2;
    top: 11px;
    left: 10px;
    font-size: 12px;
    font-weight: bold;
    background: #fff;
    padding: 0 3px;
    color: #999;
    transition: all .2s ease;
    top: -8px;
}

.form-item-yesno select {
    display: block;
    width: 100%;
    height: 30px;
    background: transparent;
    border: solid 1px #ccc;
    transition: all .2s ease;
    padding: 0 15px;
    border-radius: 4px;
}

.form .details-container-required {
    display: grid;
    grid-template-columns: 50% 50%;
    column-gap: 10px;
    align-content: center;
}

.form .details-container-required .requiredheader{
    align-content: center;
    height: 30px;
}

.form .details-container-cessfields {
    display: grid;
    grid-template-columns: auto auto auto;
    column-gap: 10px;
    align-content: center;
}

.seperetor {
    border: solid 1px #c5c5c56b;
    margin-top: 10px;
    margin-bottom: 30px;
    margin-left: 30px;
    margin-right: 30px;
}

.classification-menu .mud-button-root {
    padding: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    height: 30px;
    background: transparent;
    border: solid 1px #ccc;
    transition: all .2s ease;
    border-radius: 4px;
    width: 100%;
    text-transform: none;
}

.classification-menu-checkbox svg {
    fill: #3399ff !important;
}

/*======================================== Responsive ================================================*/
/* .form's min-width:800px forced every Create/Edit popup (all 11 Master
   pages share this file) to overflow any mobile viewport, and the 2-column
   .details-container grid made fields cramped even if the width did fit.
   Loads after CreateCompany.css (which redeclares the same .form/
   .details-container class names with identical !important values), so
   this override also wins for Main.razor's Create/Edit Company popups. */
@media (max-width: 700px) {
    .form {
        min-width: unset !important;
        width: 100% !important;
        max-height: 70vh !important;
        padding: 12px;
        box-sizing: border-box;
    }

    .form .details-container,
    .form .details-container-required,
    .form .details-container-cessfields {
        grid-template-columns: 1fr !important;
    }

    .form-item-1,
    .form-item-2 {
        grid-column-start: 1;
        grid-column-end: 2;
    }
}

/* --- GSTIN lookup ------------------------------------------------------------------------------
   The "Fetch" button beside GST No., which fills the party from the GST taxpayer register.
   See FetchGstDetails in CreateSaleAccount / CreatePurchaseAccount. */

/* The input keeps its own width:100% rule, so the row is a flex box and the input is allowed to
   shrink beside the button. .form-item stays position:relative, which is what the floating label
   is anchored to. */
.form-item.gst-lookup {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.form-item.gst-lookup input {
    flex: 1 1 auto;
    min-width: 0;
}

.gst-fetch-btn {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 12px;
    background: #0d6efd;
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s ease;
}

.gst-fetch-btn:hover {
    background: #0b5ed7;
}

.gst-fetch-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Spans both grid columns (.form-item-2) so a full sentence fits without squeezing the fields. */
.gst-fetch-note {
    margin: -8px 0 12px;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    line-height: 1.45;
    border-left: 3px solid;
}

.gst-fetch-note.is-ok {
    border-left-color: #198754;
    background: #f0f9f4;
    color: #0f5132;
}

.gst-fetch-note.is-error {
    border-left-color: #dc3545;
    background: #fdf2f3;
    color: #58151c;
}
