:root {
    --brand-bg: #f4f6fb;
    --brand-card: #ffffff;
    --brand-primary: #e94f37;
    --brand-primary-hover: #c93c28;
    --brand-accent: #008f84;
    --brand-accent-light: #e5fbf8;
    --brand-ink: #20232a;
    --brand-text-main: #20232a;
    --brand-text-sub: #687083;
    --brand-border: #20232a;
    --brand-line: #dde2ec;
    --brand-shadow: 7px 7px 0 rgba(32, 35, 42, 0.14);
    --brand-radius-card: 14px;
    --brand-radius-sm: 10px;
}

html,
body {
    min-height: 100%;
    color: var(--brand-text-main);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body {
    background-color: var(--brand-bg);
    background-image:
        linear-gradient(90deg, rgba(32, 35, 42, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(32, 35, 42, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 246, 251, 0.92)),
        var(--brand-cover, none) !important;
    background-size: 28px 28px, 28px 28px, auto, cover !important;
    background-position: center !important;
    background-repeat: repeat, repeat, no-repeat, no-repeat !important;
    background-attachment: fixed, fixed, fixed, fixed !important;
}

a {
    text-decoration: none;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: transparent !important;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before,
.auth-wrapper::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 320px;
    height: 72px;
    border: 2px solid var(--brand-border);
    background: var(--brand-accent-light);
    transform: rotate(-12deg);
    opacity: 0.9;
}

.auth-wrapper::before {
    top: 72px;
    left: -92px;
}

.auth-wrapper::after {
    right: -86px;
    bottom: 78px;
    background: #fff0ec;
    transform: rotate(10deg);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 448px;
    padding: 30px;
    border: 2px solid var(--brand-border) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--brand-text-main) !important;
    box-shadow: var(--brand-shadow) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand-header {
    margin-bottom: 22px !important;
    text-align: center;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0 !important;
}

.brand-icon {
    width: 72px !important;
    height: 72px !important;
    border: 2px solid var(--brand-border);
    border-radius: 8px !important;
    background: var(--brand-card);
    object-fit: cover;
    box-shadow: 5px 5px 0 rgba(32, 35, 42, 0.16) !important;
}

.brand-icon:hover {
    transform: translateY(-2px) rotate(-2deg) !important;
    box-shadow: 7px 7px 0 rgba(32, 35, 42, 0.2) !important;
}

.auth-title {
    color: var(--brand-ink) !important;
    font-weight: 950;
    letter-spacing: 0;
}

.auth-subtitle {
    margin-bottom: 22px !important;
    color: var(--brand-text-sub) !important;
    line-height: 1.7;
    text-align: center;
}

.text-link {
    color: var(--brand-primary) !important;
    font-weight: 900;
}

.text-link:hover {
    color: var(--brand-primary-hover) !important;
    text-decoration: underline;
}

.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    height: 54px;
    border: 2px solid var(--brand-border) !important;
    border-radius: 8px !important;
    background: var(--brand-card) !important;
    color: var(--brand-text-main) !important;
    box-shadow: none !important;
}

.form-floating > label {
    color: var(--brand-text-sub) !important;
    font-weight: 800;
}

.form-control:focus {
    border-color: var(--brand-primary) !important;
    background: #ffffff !important;
    color: var(--brand-text-main) !important;
    box-shadow: 4px 4px 0 rgba(233, 79, 55, 0.16) !important;
}

.btn {
    border-radius: 8px !important;
    font-weight: 950 !important;
    letter-spacing: 0;
}

.btn-gradient {
    min-height: 48px;
    border: 2px solid var(--brand-border) !important;
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 0 rgba(32, 35, 42, 0.16) !important;
    transition: all 0.18s ease;
}

.btn-gradient:hover,
.btn-gradient:focus {
    transform: translateY(-2px);
    background: var(--brand-primary-hover) !important;
    filter: none !important;
    box-shadow: 6px 6px 0 rgba(32, 35, 42, 0.2) !important;
}

.btn-outline-primary,
.btn-ghost {
    min-height: 48px;
    border: 2px solid var(--brand-border) !important;
    border-radius: 8px !important;
    background: var(--brand-accent-light) !important;
    color: var(--brand-accent) !important;
    box-shadow: 3px 3px 0 rgba(32, 35, 42, 0.1) !important;
}

.btn-outline-primary:hover,
.btn-ghost:hover {
    background: var(--brand-accent) !important;
    color: #ffffff !important;
}

.form-check {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 0 !important;
    margin: 0;
    color: var(--brand-text-sub) !important;
}

.form-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--brand-border) !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    cursor: pointer;
    position: relative;
    box-shadow: 2px 2px 0 rgba(32, 35, 42, 0.1);
}

.form-check input[type="checkbox"]:checked {
    background: var(--brand-accent) !important;
}

.form-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check label {
    cursor: pointer;
    color: var(--brand-text-sub);
    font-size: 13px;
    font-weight: 800;
}

.divider {
    color: var(--brand-text-sub) !important;
    font-weight: 900;
}

.divider::before,
.divider::after {
    background: var(--brand-line) !important;
}

.image-code,
.prompt-image-code {
    width: 100%;
    max-width: 156px;
    height: 54px !important;
    margin-left: 0 !important;
    border: 2px solid var(--brand-border) !important;
    border-radius: 8px !important;
    background: #ffffff;
    object-fit: cover;
    opacity: 1 !important;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(32, 35, 42, 0.1);
}

.input-icon-end .toggle-pass {
    color: var(--brand-text-sub);
}

@media (max-width: 576px) {
    .auth-wrapper {
        min-height: 100svh;
        align-items: center;
        padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    }

    .auth-wrapper::before,
    .auth-wrapper::after {
        display: none;
    }

    .auth-card {
        padding: 22px;
        box-shadow: 5px 5px 0 rgba(32, 35, 42, 0.14) !important;
    }

    .brand-icon {
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 576px) and (max-height: 620px) {
    .auth-wrapper {
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

.auth-card,
.brand-icon,
.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.btn,
.btn-gradient,
.btn-outline-primary,
.btn-ghost,
.image-code,
.prompt-image-code {
    border-radius: var(--brand-radius-card) !important;
}

.form-check input[type="checkbox"] {
    border-radius: 7px !important;
}
