/* Version: 0.1 */

:root {
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Elegant Dark Theme Palette */
    --bg-body: #09090b;
    --bg-surface: rgba(24, 24, 27, 0.45);
    --bg-surface-hover: rgba(39, 39, 42, 0.6);
    --bg-sidebar: rgba(18, 18, 18, 0.85);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);

    /* Branding & Accent Colors */
    --color-primary: #57CC99;
    --color-primary-rgb: 87, 204, 153;
    --color-primary-hover: #80ED99;
    --color-primary-gradient: var(--color-primary);

    /* Status Colors */
    --color-error: #EF4444;
    --color-error-bg: rgba(239, 68, 68, 0.1);
    --color-success: #10B981;

    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px 0 rgba(var(--color-primary-rgb), 0.15);
    --glass-blur: blur(16px);

    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-primary-rgb), 0.5);
}

/* Global Reset (when using as a layout boilerplate) */
.own-theme-reset,
.own-theme-reset * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.own-theme-reset *:focus {
    outline: none;
}

/* Authentication Screen (Unauthenticated) Wrapper */
.login-wrapper {
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
    background-color: #09090b;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(87, 204, 153, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(128, 237, 153, 0.06) 0%, transparent 50%);
    overflow: hidden;
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

.login-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

.auth-card {
    background: rgba(24, 24, 27, 0.45);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 20px 50px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 960px;
    min-height: 600px;
    display: flex;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

/* Left Brand Side styling */
.auth-brand-side {
    flex: 1;
    width: 50%;
    padding: 48px;
    background: linear-gradient(135deg, rgba(87, 204, 153, 0.12) 0%, rgba(9, 9, 11, 0.8) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Ambient glow blobs */
.brand-glow {
    position: absolute;
    border-radius: var(--radius-full);
    pointer-events: none;
    z-index: 0;
}

.brand-glow-1 {
    width: 250px;
    height: 250px;
    background: rgba(87, 204, 153, 0.15);
    filter: blur(80px);
    top: -50px;
    left: -50px;
    animation: pulse-slow 8s ease-in-out infinite alternate;
}

.brand-glow-2 {
    width: 200px;
    height: 200px;
    background: rgba(128, 237, 153, 0.1);
    filter: blur(60px);
    bottom: -50px;
    right: -50px;
    animation: pulse-slow 6s ease-in-out infinite alternate-reverse;
}

@keyframes pulse-slow {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.15) translate(10px, 10px);
        opacity: 1;
    }
}

.brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logo-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 6px 14px;
    background: rgba(87, 204, 153, 0.1);
    border: 1px solid rgba(87, 204, 153, 0.2);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 28px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-headline {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.brand-headline .accent-text {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-subline {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Interactive brand visual mockup */
.brand-visual {
    position: relative;
    flex-grow: 1;
    min-height: 180px;
    margin-top: 20px;
}

.visual-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.visual-card:hover {
    border-color: rgba(var(--color-primary-rgb), 0.2);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.visual-card-1 {
    top: 10px;
    left: 10px;
    width: 240px;
    z-index: 2;
    animation: float-card 6s ease-in-out infinite;
}

.visual-card-2 {
    bottom: 20px;
    right: 10px;
    width: 200px;
    z-index: 1;
    animation: float-card-reverse 6s ease-in-out infinite;
}

@keyframes float-card {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(1deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes float-card-reverse {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(8px) rotate(-1deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.visual-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    margin-right: 12px;
    flex-shrink: 0;
}

.visual-lines {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-right: 12px;
}

.visual-line {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

.visual-line.line-long {
    width: 80%;
}

.visual-line.line-short {
    width: 45%;
}

.visual-badge {
    padding: 4px 8px;
    border-radius: var(--radius-full);
    background: rgba(87, 204, 153, 0.15);
    border: 1px solid rgba(87, 204, 153, 0.25);
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.visual-play-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    margin-right: 12px;
    flex-shrink: 0;
}

.visual-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.visual-progress::after {
    content: '';
    display: block;
    height: 100%;
    width: 65%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

.brand-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-muted);
}

.brand-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.brand-footer a:hover {
    color: var(--color-primary);
}

/* Right Form Side styling */
.auth-form-side {
    flex: 1;
    width: 50%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-form-content {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-form-header p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Auth Mode display toggling (uses data-mode on auth-card) */
.auth-card[data-mode="login"] .auth-title-register,
.auth-card[data-mode="login"] .auth-subtitle-register,
.auth-card[data-mode="login"] .register-form {
    display: none !important;
}

.auth-card[data-mode="register"] .auth-title-login,
.auth-card[data-mode="register"] .auth-subtitle-login,
.auth-card[data-mode="login-only"] .auth-switch-text,
.auth-card[data-mode="register"] .login-form {
    display: none !important;
}

/* Auth Loading State */
.auth-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    text-align: center;
}

.auth-card.auth-loading .auth-form-content {
    display: none !important;
}

.auth-card.auth-loading .auth-loading-overlay {
    display: flex;
}

.auth-loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Forms & input controls */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--color-error);
    text-align: left;
}

.auth-error-banner svg {
    flex-shrink: 0;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.input-group input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2), 0 0 15px rgba(var(--color-primary-rgb), 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.input-group input:active {
    transform: scale(0.98);
}

/* Button styles */
.button {
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
}

.button:active {
    transform: scale(0.96);
}

.button-primary {
    background: var(--color-primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px 0 rgba(var(--color-primary-rgb), 0.3);
}

.button-primary:active {
    transform: translateY(0) scale(0.96);
}

/* UI Button Click Effects */
.add-icon-btn:active {
    transform: scale(0.95);
}

.logoutbtn-link:active {
    transform: scale(0.96);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.modal-close-btn:active {
    transform: scale(0.9);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.auth-switch-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

.auth-switch-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.auth-switch-text a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Spinner styling */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Rules */
@media (max-width: 800px),
(max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
    .auth-card {
        flex-direction: column;
        max-width: 440px;
        min-height: auto;
    }

    .auth-brand-side {
        display: none !important;
    }

    .auth-form-side {
        width: 100%;
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .auth-form-side {
        padding: 24px 16px;
    }
}