/* AccraRide - Auth Pages (Login & Register) */

:root {
    --auth-yellow: #ffbb00;
    --auth-yellow-hover: #e6a800;
    --auth-yellow-soft: #fff8e1;
    --auth-black: #111827;
    --auth-gray-700: #374151;
    --auth-gray-500: #6b7280;
    --auth-gray-400: #9ca3af;
    --auth-gray-200: #e5e7eb;
    --auth-gray-100: #f3f4f6;
    --auth-white: #ffffff;
    --auth-panel-bg: #f3f4f6;
    --auth-card-shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
    --auth-radius-lg: 20px;
    --auth-radius-md: 12px;
    --auth-radius-sm: 10px;
    --auth-brand-width: 52%;
    --auth-desktop-max-width: 1068px;
}

/* Auth page shell */
body.auth-page {
    background: var(--auth-panel-bg);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.auth-split-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--auth-brand-width)) minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Left brand panel */
.auth-brand-panel {
    background: var(--auth-white);
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.auth-brand-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 2rem 2rem 1.75rem;
    max-width: none;
    margin: 0;
    min-width: 0;
    min-height: 100%;
}

.auth-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1.75rem;
}

.auth-logo-mark {
    width: 42px;
    height: 50px;
    flex-shrink: 0;
}

.auth-logo-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.auth-logo-accra {
    color: var(--auth-black);
}

.auth-logo-ride {
    color: var(--auth-yellow);
}

.auth-brand-copy {
    margin-bottom: 1rem;
}

.auth-brand-title {
    font-size: clamp(1.875rem, 2.4vw, 2.625rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--auth-black);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.auth-brand-highlight {
    color: var(--auth-yellow);
}

.auth-brand-subtitle {
    color: var(--auth-gray-500);
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: 420px;
}

.auth-hero-image {
    position: relative;
    border-radius: var(--auth-radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
    width: 100%;
    background: var(--auth-white);
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 290px;
}

.auth-hero-image::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.15) 14%,
        rgba(255, 255, 255, 0) 28%,
        rgba(255, 255, 255, 0) 68%,
        rgba(255, 255, 255, 0.2) 82%,
        rgba(255, 255, 255, 0.95) 100%
    );
    z-index: 1;
}

.auth-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 42%;
    display: block;
    transform: scaleX(-1);
}

.auth-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin-top: auto;
    padding-top: 0.25rem;
    flex-shrink: 0;
}

.auth-feature {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.auth-feature-icon {
    width: 28px;
    height: 28px;
    color: var(--auth-yellow);
}

.auth-feature-icon svg {
    width: 100%;
    height: 100%;
}

.auth-feature strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--auth-black);
    margin-bottom: 0.125rem;
}

.auth-feature span {
    display: block;
    font-size: 0.8125rem;
    color: var(--auth-gray-500);
    line-height: 1.45;
}

/* Right form panel */
.auth-form-panel {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 1.5rem 1.75rem;
    background: var(--auth-panel-bg);
    min-width: 0;
}

.auth-form-card {
    width: 100%;
    max-width: none;
    background: var(--auth-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-card-shadow);
    padding: 2.25rem 2.25rem;
    border: 1px solid rgba(229, 231, 235, 0.65);
    display: flex;
    flex-direction: column;
}

.auth-form-card-header {
    margin-bottom: 1.75rem;
}

.auth-form-card-header h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--auth-black);
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

.auth-form-card-header p {
    color: var(--auth-gray-500);
    font-size: 0.9375rem;
}

/* Auth alerts */
.auth-page .alert {
    border-radius: var(--auth-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

/* Form fields */
.auth-form .form-group {
    margin-bottom: 1.125rem;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-black);
    margin-bottom: 0.5rem;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--auth-gray-400);
    pointer-events: none;
}

.input-icon-wrap .input-icon-right {
    left: auto;
    right: 1rem;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon-wrap input,
.input-icon-wrap select {
    width: 100%;
    height: 52px;
    padding: 0 1rem 0 2.75rem;
    border: 1px solid var(--auth-gray-200);
    border-radius: var(--auth-radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--auth-black);
    background: var(--auth-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-icon-wrap input::placeholder {
    color: var(--auth-gray-400);
}

.input-icon-wrap input:focus,
.input-icon-wrap select:focus {
    outline: none;
    border-color: var(--auth-yellow);
    box-shadow: 0 0 0 3px rgba(255, 187, 0, 0.18);
}

.input-icon-wrap.has-toggle input {
    padding-right: 2.75rem;
}

.auth-form select {
    width: 100%;
    height: 52px;
    padding: 0 1rem;
    border: 1px solid var(--auth-gray-200);
    border-radius: var(--auth-radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--auth-black);
    background: var(--auth-white);
}

.auth-form select:focus {
    outline: none;
    border-color: var(--auth-yellow);
    box-shadow: 0 0 0 3px rgba(255, 187, 0, 0.18);
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-forgot-row {
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0 1.25rem;
}

.auth-forgot-link {
    color: var(--auth-yellow);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot-link:hover {
    color: var(--auth-yellow-hover);
    text-decoration: underline;
}

/* Primary auth button */
.btn-auth-primary {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-yellow);
    color: var(--auth-black);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-auth-primary:hover {
    background: var(--auth-yellow-hover);
}

.btn-auth-primary:active {
    transform: scale(0.99);
}

.btn-auth-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-gray-400);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-gray-200);
}

/* Social buttons */
.auth-social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.btn-auth-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    height: 48px;
    border: 1px solid var(--auth-gray-200);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-white);
    color: var(--auth-black);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-auth-social.is-unconfigured {
    opacity: 0.92;
}

.btn-auth-social.is-busy {
    opacity: 0.75;
    pointer-events: none;
}

.auth-oauth-bridge {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-oauth-bridge-card {
    background: var(--auth-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-card-shadow);
    padding: 2rem;
    max-width: 420px;
    text-align: center;
}

.auth-oauth-bridge-card h1 {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}

.auth-oauth-bridge-card p {
    color: var(--auth-gray-500);
    font-size: 0.9375rem;
}

.btn-auth-social:hover {
    background: var(--auth-gray-100);
    border-color: var(--auth-gray-400);
}

.btn-auth-social:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-auth-social:disabled:hover {
    background: var(--auth-white);
    border-color: var(--auth-gray-200);
}

.btn-auth-social svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: var(--auth-gray-500);
}

.auth-form-footer a {
    color: var(--auth-yellow);
    font-weight: 700;
    text-decoration: none;
}

.auth-form-footer a:hover {
    color: var(--auth-yellow-hover);
    text-decoration: underline;
}

.role-fields {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1100px) {
    body.auth-page {
        display: block;
        padding: 0;
    }

    .auth-split-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand-panel {
        border-bottom: 1px solid var(--auth-gray-200);
    }

    .auth-brand-inner {
        max-width: none;
        padding: 1.5rem 1.5rem 0.375rem;
        height: auto;
    }

    .auth-hero-image {
        flex: none;
        max-height: 220px;
        min-height: 0;
        aspect-ratio: 16 / 10;
        margin-bottom: 0.25rem;
    }

    .auth-features {
        display: none;
    }

    .auth-feature {
        flex-direction: row;
        align-items: flex-start;
    }

    .auth-form-panel {
        align-items: flex-start;
        min-height: auto;
        overflow-y: visible;
        padding: 0.375rem 1rem 1rem;
    }

    .auth-form-card {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .auth-brand-inner {
        padding: 1rem 1rem 0.25rem;
    }

    .auth-logo-link {
        margin-bottom: 0.75rem;
        flex-direction: row;
        align-items: center;
    }

    .auth-logo-text {
        font-size: 1.375rem;
    }

    .auth-logo-mark {
        width: 34px;
        height: 40px;
    }

    .auth-brand-copy {
        margin-bottom: 0;
    }

    .auth-brand-title {
        font-size: 1.25rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .auth-brand-subtitle,
    .auth-hero-image,
    .auth-features {
        display: none;
    }

    .auth-form-panel {
        padding: 0.375rem 0.75rem 0.75rem;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .auth-form-card {
        max-width: none;
        padding: 1.25rem 1rem;
        border-radius: var(--auth-radius-md);
        box-shadow: 0 4px 18px rgba(17, 24, 39, 0.06);
        border: none;
    }

    .auth-form-card-header {
        margin-bottom: 1.25rem;
    }

    .auth-form-card-header h2 {
        font-size: 1.25rem;
    }

    .auth-form-card-header p {
        display: block;
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-form .form-group {
        margin-bottom: 1rem;
    }

    .auth-form .form-group label {
        font-size: 0.8125rem;
    }

    .input-icon-wrap input,
    .input-icon-wrap select,
    .auth-form select {
        height: 48px;
        font-size: 16px;
        padding-left: 2.75rem;
        padding-right: 1rem;
    }

    .input-icon-wrap.has-toggle input {
        padding-right: 2.75rem;
    }

    .btn-auth-primary {
        height: 48px;
        min-height: 48px;
        font-size: 0.9375rem;
    }

    .btn-auth-social {
        height: 44px;
        min-height: 44px;
        font-size: 0.875rem;
    }

    .auth-divider {
        display: flex;
        margin: 1.25rem 0;
        font-size: 0.8125rem;
    }

    .auth-social-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
    }

    .auth-form-footer {
        margin-top: 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .auth-form-panel {
        padding: 0.625rem;
        padding-left: max(0.625rem, env(safe-area-inset-left));
        padding-right: max(0.625rem, env(safe-area-inset-right));
        padding-bottom: max(0.625rem, env(safe-area-inset-bottom));
    }

    .auth-form-card {
        padding: 1rem 0.875rem;
        border: 1px solid var(--auth-gray-200);
        box-shadow: none;
    }

    .auth-social-buttons {
        grid-template-columns: 1fr;
    }

    .auth-page-login .auth-social-buttons {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .auth-brand-inner {
        padding: 0.75rem 0.75rem 0.625rem;
    }

    .auth-logo-link {
        margin-bottom: 0.5rem;
    }

    .auth-brand-title {
        font-size: 1.0625rem;
    }

    .auth-form-panel {
        padding: 0.5rem;
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .auth-form-card {
        padding: 0.875rem 0.75rem;
        border-radius: 12px;
    }

    .auth-form-card-header {
        margin-bottom: 1rem;
    }

    .auth-form-card-header h2 {
        font-size: 1.125rem;
    }

    .auth-form-card-header p {
        font-size: 0.75rem;
    }

    .auth-form .form-group label {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .auth-form .form-group {
        margin-bottom: 0.875rem;
    }

    .auth-page .alert {
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
        margin-bottom: 1rem;
    }

    .auth-forgot-row {
        margin: 0 0 1rem;
    }

    .auth-forgot-link {
        font-size: 0.8125rem;
    }

    .auth-page-login .auth-social-buttons {
        grid-template-columns: 1fr;
    }

    .btn-auth-social {
        font-size: 0.8125rem;
    }
}

@media (max-width: 360px) {
    .auth-form-card-header h2 {
        font-size: 1rem;
    }

    .input-icon-wrap .input-icon {
        left: 0.75rem;
        width: 16px;
        height: 16px;
    }

    .input-icon-wrap input,
    .input-icon-wrap select,
    .auth-form select {
        padding-left: 2.375rem;
    }

    .input-icon-wrap.has-toggle input {
        padding-right: 2.375rem;
    }

    .input-icon-wrap .input-icon-right {
        right: 0.75rem;
    }
}

@media (min-width: 1101px) {
    body.auth-page {
        display: block;
        padding: 2rem;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .auth-split-layout {
        min-height: 620px;
        height: auto;
        max-width: var(--auth-desktop-max-width);
        margin: 2rem auto;
        border-radius: var(--auth-radius-lg);
        overflow: visible;
        box-shadow: 0 14px 40px rgba(17, 24, 39, 0.1);
        grid-template-columns: minmax(0, var(--auth-brand-width)) minmax(0, 1fr);
        column-gap: 0;
    }

    .auth-brand-inner {
        height: 100%;
        padding: 2rem 2rem 1.75rem;
    }

    .auth-hero-image {
        flex: 1 1 auto;
        min-height: 200px;
        max-height: none;
        height: auto;
    }

    .auth-form-panel {
        padding: 1.5rem 1.75rem;
    }

    .auth-form-card {
        min-height: 100%;
        height: auto;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn-auth-primary,
    .btn-auth-social,
    .password-toggle,
    .auth-forgot-link {
        -webkit-tap-highlight-color: transparent;
    }
}
