/**
 * Auth Base Styles
 * Reset, typography, and color variables for login/register
 */

:root {
    /* Colors */
    --color-primary: #2b2b2b;
    --color-primary-dark: #0d2ba3;
    --color-primary-light: #5b7bff;
    --color-primary-lightest: #eff6ff;

    --color-link: #1447e6;
    --color-link-hover: #0d2ba3;

    --color-bg-primary: #f5f5f5;
    --color-bg-secondary: #ffffff;

    --color-text-primary: #2b2b2b;
    --color-text-secondary: #666666;
    --color-text-tertiary: #999999;

    --color-border: #d0d0d0;
    --color-border-light: #e5e5e5;

    --color-error: #f44336;
    --color-error-light: #ffebee;
    --color-success: #4caf50;
    --color-success-light: #e8f5e9;
    --color-warning: #ff9800;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);

    /* Typography - Centralized */
    --font-family-base:
        "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial;

    /* Font Sizes */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 32px;

    /* Line Heights */
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 600;

    /* Backward Compatibility - Old variable names */
    --font-size-sm: var(--text-xs);
    --font-size-base: var(--text-sm);
    --font-size-md: var(--text-base);
    --font-size-lg: var(--text-lg);
    --font-size-xl: var(--text-xl);
    --font-size-2xl: var(--text-2xl);
    --font-size-3xl: var(--text-3xl);
    --font-size-4xl: var(--text-4xl);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    background-color: var(--color-bg-primary);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    max-width: 500px;
    width: 100%;
}

.auth-header .eyebrow {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.auth-header h1 {
    font-size: var(--font-size-3xl);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.auth-header > p {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Auth Card */
.auth-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
}

.auth-body {
    padding: var(--spacing-2xl) 40px;
    flex: 1;
}

.auth-footer {
    padding: var(--spacing-lg) 40px;
    border-top: 1px solid var(--color-border-light);
    text-align: center;
}

.auth-footer p {
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Back to Home */
.back-to-home {
    text-align: center;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.back-to-home a {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 48px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-group textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
    padding: var(--spacing-md);
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(20, 71, 230, 0.1);
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: var(--color-error);
    background-color: var(--color-error-light);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.help-text {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

.form-group.has-error .input-error {
    display: block;
    color: var(--color-error);
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-xs);
}

.input-error {
    display: none;
    font-size: var(--font-size-sm);
}

/* Phone Input Wrapper */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.2s ease;
}

.phone-input-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(20, 71, 230, 0.1);
}

.phone-prefix {
    padding: 0 var(--spacing-md);
    background-color: #f5f5f5;
    border-right: 1px solid var(--color-border);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    white-space: nowrap;
    user-select: none;
}

.phone-input-wrapper input {
    flex: 1;
    border: none;
    height: 48px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
}

.phone-input-wrapper input:focus {
    outline: none;
    box-shadow: none;
}

.form-group.has-error .phone-input-wrapper {
    border-color: var(--color-error);
    background-color: var(--color-error-light);
}

/* Social media input: prefix berisi ikon platform (2 class agar tidak tertimpa auth-responsive) */
.phone-prefix.social-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 48px;
    padding: 0;
    font-size: 18px;
}

/* Buttons */
.btn {
    padding: 0 var(--spacing-md);
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--color-text-primary);
    width: 100%;
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
    color: var(--color-text-primary);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-link {
    background: none;
    color: var(--color-primary);
    padding: 0;
    height: auto;
    width: auto;
    font-weight: var(--font-weight-semibold);
}

.btn-link:hover {
    text-decoration: underline;
}

/* Button Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-secondary.loading::after {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--color-text-primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-xl) 0;
    color: var(--color-text-tertiary);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
}

.divider span {
    padding: 0 var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

/* Required asterisk */
.required {
    color: var(--color-error);
}

/* Section Titles (for Register) */
.section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.section-optional {
    padding-top: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border-top: 2px dashed var(--color-border);
}

.optional-badge {
    display: inline-block;
    background-color: #f0f0f0;
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-left: var(--spacing-sm);
}

.section-optional-note {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* Checkbox Wrapper */
.checkbox-wrapper {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: #f9f9f9;
    border-radius: var(--radius-md);
}

.checkbox-wrapper label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0;
    font-weight: var(--font-weight-regular);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.checkbox-wrapper span {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.checkbox-wrapper a {
    font-weight: var(--font-weight-semibold);
}

/* Link styling in alerts */
a.link {
    color: var(--color-primary);
    text-decoration: underline;
}

a.link:hover {
    color: var(--color-primary-dark);
}

/* ============================================
   Two-Column Split Layout (Login Page)
   ============================================ */

.auth-split-body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: "Instrument Sans";
}

.auth-split-layout {
    display: flex;
    height: 100vh;
    background: #fff;
}

/* Left Panel */
.auth-split-left {
    flex: 0 0 45%;
    height: 100vh;
    position: sticky;
    top: 0;
    background-image: url("https://images.unsplash.com/photo-1584438784894-089d6a62b8fa?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    overflow: hidden;
}

.auth-split-left::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.65) 100%
    );
    pointer-events: none;
}

.auth-split-badge {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-split-badge span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-split-badge-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.45);
}

.auth-split-quote {
    position: relative;
    z-index: 1;
}

.auth-split-quote h2 {
    font-family: "Instrument Sans";
    color: #ffffff;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 16px;
}

.auth-split-quote p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin: 0;
    max-width: 340px;
}

/* Right Panel */
.auth-split-right {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #ffffff;
}

.auth-split-right-inner {
    width: 100%;
    max-width: 400px;
}

/* Logo */
.auth-split-logo {
    margin-bottom: 40px;
    display: flex;
    justify-content: flex-end;
}

.auth-split-logo-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-lg);
    color: var(--color-text-primary);
}

.auth-split-logo-text i {
    color: var(--color-primary);
    font-size: 20px;
}

/* Heading */
.auth-split-heading {
    margin-bottom: 32px;
}

.auth-split-heading h1 {
    font-family: "Instrument Sans";
    font-size: 36px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.auth-split-heading p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Right panel scrollable variant (for register) */
.auth-split-right--scroll {
    align-items: flex-start;
    padding-top: 56px;
    padding-bottom: 56px;
}

/* Form sections inside split layout */
.auth-form-section {
    margin-bottom: 28px;
}

.auth-form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.auth-form-section-title i {
    color: var(--color-primary);
    font-size: 15px;
}

.auth-form-section--optional {
    padding-top: 24px;
    border-top: 2px dashed var(--color-border);
}

.auth-form-section-note {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.auth-form-section-note i {
    color: var(--color-warning);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Dark solid button variant */
.btn-dark-solid {
    background-color: #1a1a1a;
    color: #ffffff;
    width: 100%;
    border: none;
}

.btn-dark-solid:hover:not(:disabled) {
    background-color: #000000;
    box-shadow: var(--shadow-md);
}

.btn-dark-solid:active:not(:disabled) {
    transform: translateY(1px);
}

/* Footer link */
.auth-split-footer {
    margin-top: 28px;
    text-align: center;
}

.auth-split-footer p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.auth-split-footer a {
    color: var(--color-link);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
}

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

.auth-hyperlink {
    color: var(--color-link);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
}

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