/* =========================================================
   STORM INDUSTRIES
   AUTHENTICATION PAGES
   Login + Register
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --storm-orange: #F57A1B;
    --storm-cream: #FFEFD5;

    --auth-bg: #f8f8f8;
    --auth-card: #ffffff;
    --auth-text: #171717;
    --auth-muted: #707070;
    --auth-border: #e5e5e5;

    --auth-shadow:
        0 25px 70px rgba(0, 0, 0, 0.12);

    --auth-radius: 24px;
    --input-radius: 13px;

    --danger: #dc3545;
    --success: #198754;
}


/* =========================================================
   DARK THEME
   ========================================================= */

[data-theme="dark"] {
    --auth-bg: #101010;
    --auth-card: #181818;
    --auth-text: #ffffff;
    --auth-muted: #aaaaaa;
    --auth-border: #303030;

    --auth-shadow:
        0 25px 70px rgba(0, 0, 0, 0.45);
}


/* =========================================================
   RESET
   ========================================================= */

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}


/* =========================================================
   AUTH PAGE
   ========================================================= */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;

    display: grid;
    grid-template-columns: 1fr 1fr;

    background: var(--auth-bg);

    color: var(--auth-text);
}


/* =========================================================
   LEFT VISUAL SIDE
   ========================================================= */

.auth-visual {
    position: relative;

    min-height: 100vh;

    display: flex;
    align-items: center;

    padding: 70px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #171717 0%,
            #252525 50%,
            #111111 100%
        );
}


/* Decorative orange glow */

.auth-visual::before {
    content: "";

    position: absolute;

    width: 450px;
    height: 450px;

    right: -180px;
    top: -150px;

    border-radius: 50%;

    background: var(--storm-orange);

    opacity: 0.12;

    filter: blur(10px);
}


.auth-visual::after {
    content: "";

    position: absolute;

    width: 350px;
    height: 350px;

    left: -170px;
    bottom: -150px;

    border-radius: 50%;

    background: var(--storm-orange);

    opacity: 0.08;
}


/* =========================================================
   VISUAL OVERLAY
   ========================================================= */

.auth-visual-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(245, 122, 27, 0.05),
            transparent 55%
        );

    pointer-events: none;
}


/* =========================================================
   VISUAL CONTENT
   ========================================================= */

.auth-visual-content {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 620px;

    margin: auto;
}


/* =========================================================
   LOGO
   ========================================================= */

.auth-logo {
    display: inline-flex;

    width: 130px;
    height: 130px;

    margin-bottom: 35px;

    border-radius: 22px;

    overflow: hidden;

    background: #ffffff;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.auth-logo:hover {
    transform: translateY(-5px);

    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.35);
}


.auth-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;
}


/* =========================================================
   BADGE
   ========================================================= */

.auth-badge {
    display: inline-flex;

    align-items: center;
    gap: 9px;

    padding: 8px 15px;

    margin-bottom: 20px;

    border: 1px solid rgba(245, 122, 27, 0.35);

    border-radius: 999px;

    color: var(--storm-orange);

    background: rgba(245, 122, 27, 0.08);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.auth-badge i {
    font-size: 13px;
}


/* =========================================================
   VISUAL TITLE
   ========================================================= */

.auth-visual h1 {
    margin: 0 0 20px;

    color: #ffffff;

    font-size: clamp(38px, 4vw, 65px);

    line-height: 1.05;

    font-weight: 800;

    letter-spacing: -0.04em;
}


.auth-visual-content > p {
    max-width: 520px;

    margin: 0 0 40px;

    color: rgba(255, 255, 255, 0.72);

    font-size: 16px;

    line-height: 1.8;
}


/* =========================================================
   FEATURES
   ========================================================= */

.auth-features {
    display: flex;

    flex-direction: column;

    gap: 17px;
}


.auth-feature {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 14px 16px;

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.035);

    backdrop-filter: blur(10px);

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;
}


.auth-feature:hover {
    transform: translateX(6px);

    border-color:
        rgba(245, 122, 27, 0.35);

    background:
        rgba(245, 122, 27, 0.07);
}


.auth-feature-icon {
    flex: 0 0 43px;

    width: 43px;
    height: 43px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: var(--storm-orange);

    background:
        rgba(245, 122, 27, 0.12);
}


.auth-feature strong {
    display: block;

    margin-bottom: 4px;

    color: #ffffff;

    font-size: 14px;
}


.auth-feature span {
    display: block;

    color: rgba(255, 255, 255, 0.55);

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   RIGHT SIDE
   ========================================================= */

.auth-form-section {
    position: relative;

    min-height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 25px 55px;

    background: var(--auth-bg);
}


/* =========================================================
   TOP CONTROLS
   ========================================================= */

.auth-top-controls {
    width: 100%;

    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}


.auth-home-link {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: var(--auth-muted);

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


.auth-home-link:hover {
    color: var(--storm-orange);

    transform: translateX(-3px);
}


/* =========================================================
   CONTROLS
   ========================================================= */

.auth-controls {
    display: flex;

    align-items: center;

    gap: 8px;
}


.auth-control {
    width: 42px;
    height: 42px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    border: 1px solid var(--auth-border);

    border-radius: 12px;

    background: var(--auth-card);

    color: var(--auth-text);

    cursor: pointer;

    transition:
        border-color 0.25s ease,
        color 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}


.auth-control:hover {
    color: var(--storm-orange);

    border-color: var(--storm-orange);

    transform: translateY(-2px);
}


/* =========================================================
   FORM CONTAINER
   ========================================================= */

.auth-form-container {
    width: 100%;
    max-width: 520px;

    margin: auto;
}


.register-container {
    max-width: 580px;
}


/* =========================================================
   FORM HEADER
   ========================================================= */

.auth-form-header {
    text-align: center;

    margin-bottom: 30px;
}


.auth-form-icon {
    width: 58px;
    height: 58px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 17px;

    color: var(--storm-orange);

    background:
        rgba(245, 122, 27, 0.1);

    font-size: 21px;
}


.auth-form-header h2 {
    margin: 0 0 9px;

    color: var(--auth-text);

    font-size: 32px;

    font-weight: 800;

    letter-spacing: -0.03em;
}


.auth-form-header p {
    margin: 0;

    color: var(--auth-muted);

    font-size: 14px;

    line-height: 1.6;
}


/* =========================================================
   AUTH MESSAGES
   ========================================================= */

.auth-message {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    padding: 13px 15px;

    margin-bottom: 20px;

    border-radius: 12px;

    font-size: 13px;

    line-height: 1.5;
}


.auth-message[hidden] {
    display: none;
}


.auth-error {
    color: var(--danger);

    border: 1px solid rgba(220, 53, 69, 0.25);

    background:
        rgba(220, 53, 69, 0.08);
}


.auth-success {
    color: var(--success);

    border: 1px solid rgba(25, 135, 84, 0.25);

    background:
        rgba(25, 135, 84, 0.08);
}


/* =========================================================
   FORM
   ========================================================= */

.auth-form {
    display: flex;

    flex-direction: column;

    gap: 19px;
}


.form-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 15px;
}


.form-group {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.form-group label {
    color: var(--auth-text);

    font-size: 13px;

    font-weight: 700;
}


/* =========================================================
   LABEL ROW
   ========================================================= */

.form-label-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;
}


.forgot-password {
    color: var(--storm-orange);

    font-size: 12px;

    font-weight: 600;

    text-decoration: none;
}


.forgot-password:hover {
    text-decoration: underline;
}


/* =========================================================
   INPUT WRAPPER
   ========================================================= */

.input-wrapper {
    position: relative;

    display: flex;

    align-items: center;
}


.input-wrapper > i {
    position: absolute;

    left: 15px;

    color: var(--auth-muted);

    font-size: 14px;

    pointer-events: none;

    transition: color 0.25s ease;
}


.input-wrapper input {
    width: 100%;

    height: 52px;

    padding:
        0 45px 0 44px;

    border: 1px solid var(--auth-border);

    border-radius: var(--input-radius);

    outline: none;

    background: var(--auth-card);

    color: var(--auth-text);

    font-family: inherit;

    font-size: 14px;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}


.input-wrapper select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--auth-border);
    border-radius: var(--input-radius);
    outline: none;
    background: var(--auth-card);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.input-wrapper select:focus {
    border-color: var(--storm-orange);
    box-shadow: 0 0 0 4px rgba(245, 122, 27, 0.10);
}


.input-wrapper input::placeholder {
    color: var(--auth-muted);

    opacity: 0.65;
}


.input-wrapper input:focus {
    border-color: var(--storm-orange);

    box-shadow:
        0 0 0 4px rgba(245, 122, 27, 0.10);
}


.input-wrapper:focus-within > i {
    color: var(--storm-orange);
}


/* =========================================================
   PASSWORD TOGGLE
   ========================================================= */

.password-toggle {
    position: absolute;

    right: 8px;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: var(--auth-muted);

    cursor: pointer;

    transition:
        color 0.25s ease,
        background 0.25s ease;
}


.password-toggle:hover {
    color: var(--storm-orange);

    background:
        rgba(245, 122, 27, 0.08);
}


/* =========================================================
   FORM OPTIONS
   ========================================================= */

.form-options {
    display: flex;

    align-items: center;

    justify-content: space-between;
}


.terms-option {
    align-items: flex-start;
}


.checkbox-label {
    position: relative;

    display: flex;

    align-items: flex-start;

    gap: 10px;

    color: var(--auth-muted);

    font-size: 12px;

    line-height: 1.5;

    cursor: pointer;
}


.checkbox-label input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}


.custom-checkbox {
    flex: 0 0 18px;

    width: 18px;
    height: 18px;

    margin-top: 1px;

    border: 1px solid var(--auth-border);

    border-radius: 5px;

    background: var(--auth-card);

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.checkbox-label input:checked + .custom-checkbox {
    border-color: var(--storm-orange);

    background: var(--storm-orange);
}


.checkbox-label input:checked + .custom-checkbox::after {
    content: "✓";

    display: flex;

    align-items: center;
    justify-content: center;

    height: 100%;

    color: #ffffff;

    font-size: 12px;

    font-weight: 800;
}


/* =========================================================
   SUBMIT BUTTON
   ========================================================= */

.auth-submit {
    position: relative;

    width: 100%;

    min-height: 54px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-top: 4px;

    padding: 14px 20px;

    border: 0;

    border-radius: 14px;

    background: var(--storm-orange);

    color: #ffffff;

    font-family: inherit;

    font-size: 14px;

    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 12px 30px rgba(245, 122, 27, 0.22);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.25s ease;
}


.auth-submit:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 35px rgba(245, 122, 27, 0.30);
}


.auth-submit:active {
    transform: translateY(0);
}


.auth-submit:disabled {
    opacity: 0.65;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   BUTTON LOADER
   ========================================================= */

.button-loader {
    width: 17px;
    height: 17px;

    border: 2px solid rgba(255, 255, 255, 0.35);

    border-top-color: #ffffff;

    border-radius: 50%;

    animation: authSpin 0.7s linear infinite;
}


.button-loader[hidden] {
    display: none;
}


@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   PASSWORD STRENGTH
   ========================================================= */

.password-strength {
    display: flex;

    flex-direction: column;

    gap: 6px;

    margin-top: 3px;
}


.password-strength-bar {
    width: 100%;
    height: 4px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--auth-border);
}


.password-strength-bar span {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--storm-orange);

    transition:
        width 0.3s ease,
        background 0.3s ease;
}


.password-strength small {
    min-height: 15px;

    color: var(--auth-muted);

    font-size: 11px;
}


/* =========================================================
   AUTH SWITCH
   ========================================================= */

.auth-switch {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 5px;

    margin-top: 25px;

    color: var(--auth-muted);

    font-size: 13px;

    text-align: center;
}


.auth-switch a {
    color: var(--storm-orange);

    font-weight: 700;

    text-decoration: none;
}


.auth-switch a:hover {
    text-decoration: underline;
}


/* =========================================================
   BACK LINK
   ========================================================= */

.auth-back-link {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 18px;

    color: var(--auth-muted);

    font-size: 12px;

    text-decoration: none;

    transition:
        color 0.25s ease;
}


.auth-back-link:hover {
    color: var(--storm-orange);
}


/* =========================================================
   LOADER
   ========================================================= */

.auth-page ~ .page-loader {
    z-index: 9999;
}
.page-loader {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    justify-content: center;

    align-items: center;

    background: var(--bg);

    transition:
        opacity .7s ease,
        visibility .7s ease;
}


.page-loader.hidden {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


.loader-content {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 30px;
}


.loader-logo {

    width: 150px;

    height: 150px;

    object-fit: contain;

    animation: loaderPulse 1.8s infinite;
}


.loader-line {

    width: 180px;

    height: 3px;

    background: var(--border);

    overflow: hidden;
}


.loader-line span {

    display: block;

    width: 40%;

    height: 100%;

    background: var(--storm-orange);

    animation: loaderProgress 1.5s infinite;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .auth-visual {
        padding: 50px;
    }

    .auth-form-section {
        padding: 25px 40px;
    }

    .auth-visual h1 {
        font-size: 45px;
    }

}


@media (max-width: 850px) {

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: auto;

        padding:
            55px 30px;
    }

    .auth-visual-content {
        max-width: 700px;
    }

    .auth-visual h1 {
        font-size: 42px;
    }

    .auth-form-section {
        min-height: auto;

        padding:
            25px 30px 50px;
    }

}


@media (max-width: 600px) {

    .auth-visual {
        padding:
            40px 20px;
    }

    .auth-logo {
        width: 95px;
        height: 95px;

        margin-bottom: 25px;

        border-radius: 17px;
    }

    .auth-visual h1 {
        font-size: 36px;
    }

    .auth-visual-content > p {
        font-size: 14px;

        line-height: 1.7;
    }

    .auth-form-section {
        padding:
            20px 18px 40px;
    }

    .auth-top-controls {
        margin-bottom: 30px;
    }

    .auth-form-container,
    .register-container {
        max-width: 100%;
    }

    .auth-form-header h2 {
        font-size: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 19px;
    }

    .auth-feature {
        padding: 12px;
    }

    .auth-control {
        width: 39px;
        height: 39px;
    }

}


@media (max-width: 400px) {

    .auth-visual h1 {
        font-size: 31px;
    }

    .auth-form-section {
        padding-left: 14px;
        padding-right: 14px;
    }

    .auth-form {
        gap: 16px;
    }

    .input-wrapper input {
        height: 50px;
    }

}
