/* ============================================================
   Sungrow partner auth (login / register)
   A premium, renewable-energy branded layer for the dealer and
   installer sign-in / registration pages. Scoped with .sg-auth-*
   so it never leaks into the rest of the site.
   ============================================================ */

:root {
    --sg-auth-navy: #0a2a4a;
    --sg-auth-navy-deep: #051629;
    --sg-auth-blue: #0c4b89;
    --sg-auth-orange: #ff7900;
    --sg-auth-orange-hover: #e96e00;
    --sg-auth-orange-link: #b84d00;
    --sg-auth-orange-link-hover: #8f3c00;
    --sg-auth-ink: #122a3d;
    --sg-auth-mist: #5b7286;
    --sg-auth-line: #e3eaf2;
    --sg-auth-danger: #c0392b;
}

.sg-auth-page {
    position: relative;
    padding: 128px 0 88px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(12, 75, 137, 0.55), transparent 58%),
        linear-gradient(165deg, #0c4b89 0%, #0a2a4a 46%, #051629 100%);
    overflow: hidden;
}

.sg-auth-inner {
    max-width: 1060px;
    margin: 0 auto;
}

/* ---- Split card ---- */
.sg-auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 34px 90px rgba(3, 15, 30, 0.5);
}

/* ---- Brand panel (navy + solar motif) ---- */
.sg-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px;
    color: #fff;
    background: linear-gradient(158deg, #0c4b89 0%, #0a2a4a 48%, #051629 100%);
    overflow: hidden;
}

/* Photovoltaic cell grid */
.sg-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}

/* Sun glow */
.sg-auth-sun {
    position: absolute;
    right: -88px;
    top: -88px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 42% 40%,
        rgba(255, 201, 112, 0.9),
        rgba(255, 121, 0, 0.42) 52%,
        transparent 72%
    );
    box-shadow:
        0 0 0 30px rgba(255, 121, 0, 0.07),
        0 0 0 64px rgba(255, 121, 0, 0.04);
    pointer-events: none;
}

.sg-auth-brand__inner {
    position: relative;
    z-index: 1;
}

.sg-auth-wordmark {
    margin: 0 0 34px;
    font-family: var(--title-font);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.14em;
    line-height: 1;
    color: #fff;
}

.sg-auth-wordmark span {
    display: block;
    margin-top: 8px;
    font-family: var(--body-font);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--sg-auth-orange);
}

.sg-auth-brand__title {
    margin: 0 0 16px;
    font-family: var(--title-font);
    font-weight: 700;
    font-size: clamp(1.85rem, 3.2vw, 2.5rem);
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: #fff;
    max-width: 15ch;
}

.sg-auth-brand__copy {
    margin: 0;
    font-family: var(--body-font);
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
    max-width: 34ch;
}

.sg-auth-brand__trust {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--body-font);
    font-weight: 500;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.sg-auth-brand__trust i {
    font-size: 1.05rem;
    color: var(--sg-auth-orange);
}

/* ---- Form panel (white) ---- */
.sg-auth-form {
    padding: 48px 46px;
}

.sg-auth-form__title {
    margin: 0 0 8px;
    font-family: var(--title-font);
    font-weight: 700;
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    line-height: 1.1;
    color: var(--sg-auth-ink);
}

.sg-auth-form__sub {
    margin: 0 0 28px;
    font-family: var(--body-font);
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--sg-auth-mist);
}

/* Alerts */
.sg-auth-alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-family: var(--body-font);
    font-size: 0.9rem;
    line-height: 1.5;
}

.sg-auth-alert--success {
    background: #e9f7ef;
    border: 1px solid #c3e8d1;
    color: #14532d;
}

.sg-auth-alert--error {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #7b241c;
}

/* Fields */
.sg-auth-field {
    margin-bottom: 18px;
}

.sg-auth-field label {
    display: block;
    margin-bottom: 7px;
    font-family: var(--title-font);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--sg-auth-ink);
}

.sg-auth-input {
    display: block;
    width: 100%;
    padding: 13px 15px;
    font-family: var(--body-font);
    font-size: 1rem;
    color: var(--sg-auth-ink);
    background-color: #fff;
    border: 1px solid var(--sg-auth-line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sg-auth-input::placeholder {
    color: #8b9cb0;
}

.sg-auth-input:focus {
    outline: none;
    border-color: var(--sg-auth-orange);
    box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.16);
}

.sg-auth-field--error .sg-auth-input {
    border-color: var(--sg-auth-danger);
}

.sg-auth-select {
    display: block;
    width: 100%;
    padding: 13px 40px 13px 15px;
    font-family: var(--body-font);
    font-size: 1rem;
    color: var(--sg-auth-ink);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='%235b7286'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    border: 1px solid var(--sg-auth-line);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sg-auth-select:focus {
    outline: none;
    border-color: var(--sg-auth-orange);
    box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.16);
}

.sg-auth-field--error .sg-auth-select {
    border-color: var(--sg-auth-danger);
}

.sg-auth-error {
    margin: 7px 0 0;
    font-family: var(--body-font);
    font-size: 0.84rem;
    color: var(--sg-auth-danger);
}

/* Remember row */
.sg-auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 22px;
    font-family: var(--body-font);
    font-size: 0.9rem;
    color: var(--sg-auth-ink);
}

.sg-auth-remember input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--sg-auth-orange);
    cursor: pointer;
}

/* Submit */
.sg-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 15px 20px;
    font-family: var(--title-font);
    font-weight: 700;
    font-size: 1rem;
    color: var(--sg-auth-navy-deep);
    background-color: var(--sg-auth-orange);
    border: 1px solid var(--sg-auth-orange);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sg-auth-submit:hover {
    background-color: var(--sg-auth-orange-hover);
    border-color: var(--sg-auth-orange-hover);
}

.sg-auth-submit:focus-visible {
    outline: 3px solid rgba(255, 121, 0, 0.4);
    outline-offset: 2px;
}

/* Footer links */
.sg-auth-foot {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--sg-auth-line);
    font-family: var(--body-font);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--sg-auth-mist);
}

.sg-auth-foot a {
    color: var(--sg-auth-orange-link);
    font-weight: 600;
    text-decoration: none;
}

.sg-auth-foot a:hover {
    color: var(--sg-auth-orange-link-hover);
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sg-auth-page {
        padding: 108px 0 64px;
    }

    .sg-auth-layout {
        grid-template-columns: 1fr;
    }

    .sg-auth-brand {
        padding: 34px 28px;
    }

    .sg-auth-wordmark {
        margin-bottom: 22px;
    }

    .sg-auth-brand__copy {
        max-width: 46ch;
    }

    .sg-auth-form {
        padding: 32px 28px;
    }
}

@media (max-width: 575.98px) {
    .sg-auth-page {
        padding: 100px 0 56px;
    }

    .sg-auth-brand {
        padding: 28px 22px;
    }

    .sg-auth-form {
        padding: 28px 22px;
    }

    .sg-auth-sun {
        right: -110px;
        top: -110px;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sg-auth-submit {
        transition: none;
    }
}
