/* =========================
   ADMIN FORM PAGE
========================= */

.admin-form-page {
    width: 100%;
    min-height: calc(100vh - 96px);
    background: #f3f2ee;
    color: #050505;
}

.admin-form-shell {
    width: min(100% - 32px, 1180px);
    margin: 0 auto;
    padding: clamp(34px, 3.4vw, 58px) 0 clamp(58px, 5vw, 86px);
}

/* =========================
   HEAD
========================= */

.admin-form-head {
    margin-bottom: clamp(28px, 3vw, 44px);
}

.admin-form-back {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: clamp(18px, 1.8vw, 28px);
    color: #050505;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    transition: color 0.18s ease;
}

.admin-form-back:hover {
    color: #ff2118;
}

.admin-form-head__accent {
    width: 58px;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
}

.admin-form-head__accent span {
    width: 9px;
    height: 24px;
    display: block;
    background: #ff2118;
    transform: skewX(-16deg);
}

.admin-form-head h1 {
    max-width: 900px;
    margin: 0;
    color: #050505;
    font-family: var(--font-display);
    font-size: clamp(48px, 5.4vw, 92px);
    font-weight: 400;
    line-height: 0.78;
    letter-spacing: -0.085em;
    text-transform: uppercase;
    transform: scaleX(0.96) scaleY(1.1);
    transform-origin: left bottom;
}

.admin-form-head p {
    max-width: 560px;
    margin: clamp(18px, 1.45vw, 24px) 0 0;
    color: rgba(5, 5, 5, 0.58);
    font-size: clamp(13px, 0.92vw, 16px);
    font-weight: 800;
    line-height: 1.34;
}

/* =========================
   CARD
========================= */

.admin-form-card {
    width: 100%;
    border: 1px solid rgba(5, 5, 5, 0.16);
    background: rgba(255, 255, 255, 0.14);
}

.admin-form {
    width: 100%;
    margin: 0;
    padding: clamp(22px, 2.4vw, 36px);
}

/* =========================
   ALERT
========================= */

.admin-form-alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 33, 24, 0.28);
    background: rgba(255, 33, 24, 0.08);
    color: #b71c1c;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.admin-form-alert ul {
    margin: 0;
    padding-left: 18px;
}

/* =========================
   GRID
========================= */

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 2px solid #050505;
}

.admin-form-field {
    min-width: 0;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(5, 5, 5, 0.16);
}

.admin-form-field:nth-child(odd) {
    padding-right: clamp(24px, 3vw, 46px);
}

.admin-form-field:nth-child(even) {
    padding-left: clamp(24px, 3vw, 46px);
    border-left: 1px solid rgba(5, 5, 5, 0.12);
}

.admin-form-field label {
    display: block;
    margin-bottom: 9px;
    color: rgba(5, 5, 5, 0.58);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.012em;
    text-transform: uppercase;
}

.admin-form-field label em {
    color: #ff2118;
    font-style: normal;
}

.admin-form-input {
    width: 100%;
}

/* =========================
   INPUTS
========================= */

.admin-form-input input:not([type="checkbox"]),
.admin-form-input select,
.admin-form-input textarea {
    width: 100% !important;
    min-height: 42px !important;
    padding: 0 2px !important;
    border: 0 !important;
    border-bottom: 2px solid rgba(5, 5, 5, 0.34) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #050505 !important;
    font-size: clamp(14px, 0.98vw, 17px) !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.18s ease;
}

.admin-form-input textarea {
    min-height: 118px !important;
    padding-top: 10px !important;
    resize: vertical;
    line-height: 1.35 !important;
}

.admin-form-input select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.admin-form-input input:not([type="checkbox"]):focus,
.admin-form-input select:focus,
.admin-form-input textarea:focus {
    border-bottom-color: #ff2118 !important;
}

.admin-form-input input::placeholder,
.admin-form-input textarea::placeholder {
    color: rgba(5, 5, 5, 0.38);
    font-weight: 800;
    opacity: 1;
}

.admin-form-input input[type="file"] {
    min-height: 46px !important;
    padding-top: 10px !important;
    font-size: 13px !important;
    cursor: pointer;
}

.admin-form-input input[type="file"]::file-selector-button {
    min-height: 32px;
    margin-right: 14px;
    padding: 0 14px;
    border: 1px solid rgba(5, 5, 5, 0.26);
    border-radius: 0;
    background: transparent;
    color: #050505;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.admin-form-input input[type="file"]::file-selector-button:hover {
    border-color: #050505;
    background: #050505;
    color: #ffffff;
}

/* =========================
   CHECKBOX
========================= */

.admin-form-field--checkbox {
    justify-content: center;
}

.admin-form-checkbox {
    position: relative;
    min-height: 44px;
    display: inline-grid !important;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    cursor: pointer;
}

.admin-form-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-form-checkbox__box {
    width: 24px;
    height: 24px;
    display: block;
    border: 1px solid rgba(5, 5, 5, 0.34);
    background: transparent;
    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.admin-form-checkbox__text {
    color: #050505;
    font-size: clamp(14px, 0.98vw, 17px);
    font-weight: 900;
    line-height: 1.2;
    text-transform: none;
}

.admin-form-checkbox input[type="checkbox"]:checked + .admin-form-checkbox__box {
    border-color: #ff2118;
    background: #ff2118;
}

.admin-form-checkbox input[type="checkbox"]:checked + .admin-form-checkbox__box::after {
    content: "";
    width: 8px;
    height: 13px;
    display: block;
    margin: 3px auto 0;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
}

/* =========================
   HELP / ERRORS
========================= */

.admin-form-help {
    margin: 8px 0 0;
    color: rgba(5, 5, 5, 0.48);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.admin-form-error {
    margin-top: 8px;
    color: #d50000;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.admin-form-error ul {
    margin: 0;
    padding-left: 18px;
}

/* =========================
   ACTIONS
========================= */

.admin-form-actions {
    display: grid;
    grid-template-columns: minmax(220px, 420px) minmax(140px, auto);
    gap: 12px;
    align-items: center;
    margin-top: clamp(24px, 2.4vw, 34px);
}

.admin-form-submit {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 0 24px;
    border: 1px solid #ff2118;
    border-radius: 0;
    background: #ff2118;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: clamp(11px, 0.82vw, 14px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.admin-form-submit span {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.admin-form-submit:hover {
    border-color: #050505;
    background: #050505;
    color: #ffffff;
}

.admin-form-cancel {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border: 1px solid rgba(5, 5, 5, 0.28);
    background: transparent;
    color: #050505;
    font-family: var(--font-display);
    font-size: clamp(11px, 0.78vw, 13px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.admin-form-cancel:hover {
    border-color: #050505;
    background: #050505;
    color: #ffffff;
}

/* =========================
   AUTOFILL
========================= */

.admin-form-input input:-webkit-autofill,
.admin-form-input input:-webkit-autofill:hover,
.admin-form-input input:-webkit-autofill:focus,
.admin-form-input input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f3f2ee inset !important;
    -webkit-text-fill-color: #050505 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 860px) {
    .admin-form-shell {
        width: min(100% - 18px, 1180px);
        padding-top: 26px;
        padding-bottom: 52px;
    }

    .admin-form-head h1 {
        font-size: clamp(42px, 14vw, 68px);
        transform: scaleX(0.98) scaleY(1.08);
    }

    .admin-form-head p {
        font-size: 13px;
    }

    .admin-form-card {
        border: 0;
        background: transparent;
    }

    .admin-form {
        padding: 0;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-field,
    .admin-form-field:nth-child(odd),
    .admin-form-field:nth-child(even) {
        min-height: 82px;
        padding: 16px 0 !important;
        border-left: 0 !important;
    }

    .admin-form-actions {
        grid-template-columns: 1fr;
    }

    .admin-form-submit,
    .admin-form-cancel {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .admin-form-shell {
        width: min(100% - 14px, 1180px);
    }

    .admin-form-head h1 {
        font-size: 38px;
        transform: none;
    }

    .admin-form-head__accent {
        margin-bottom: 14px;
    }

    .admin-form-input input:not([type="checkbox"]),
    .admin-form-input select,
    .admin-form-input textarea {
        font-size: 14px !important;
    }
}