/* Amani Simple Centered Redesign Theme */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Page & Card Backgrounds */
  --page-bg: rgba(199, 56, 12, 0.97);
  --card-bg: #FFF5F0;

  /* Text & Accent Tokens */
  --text-primary: #1c1917;
  --text-muted: #78716c;
  --text-dim: #a8a29e;

  --accent: #c7380c;
  --accent-hover: #a82e09;

  --border-light: #e7e5e4;
  --border-focus: #c7380c;

  --error-bg: #fef2f2;
  --error-border: #fca5a5;
  --error-text: #991b1b;
  --error-highlight: #dc2626;

  /* Typography Scale */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 14px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--page-bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.hidden-asset {
    display: none !important;
}

/* Vertical Inward-Facing Wall SVGs */
.wall-graphic {
    position: fixed;
    top: 50%;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.wall-graphic svg {
    height: 82vh;
    width: auto;
    max-height: 880px;
    opacity: 0.55;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.wall-graphic svg path {
    fill: #FFF5F0;
}

.wall-left {
    left: 45px;
    transform: translateY(-50%);
}

.wall-right {
    right: 45px;
    transform: translateY(-50%) scaleX(-1);
}

/* Main Container - Absolute Centering */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    padding: 24px;
    background-color: var(--page-bg);
    position: relative;
    z-index: 2;
}

/* Login Card Section - User specified background: #FFF5F0 */
.login-card {
    width: 100%;
    max-width: 440px;
    background: #FFF5F0;
    border: 1px solid rgba(199, 56, 12, 0.12);
    border-radius: var(--radius-md);
    padding: 44px 36px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Shake Animation on Login Error */
.login-card.shake {
    animation: cardShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Header Section & Logo */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.logo-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(199, 56, 12, 0.2);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(199, 56, 12, 0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.logo-icon-badge:hover {
    transform: scale(1.06);
    border-color: var(--accent);
}

.msingiai-logo-svg {
    display: block;
}

.logo-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(199, 56, 12, 0.2);
    background: #ffffff;
    padding: 4px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(199, 56, 12, 0.12);
    transition: transform 0.2s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.login-header h2 {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.login-header p {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Auth Error Message Banner */
.auth-error-banner {
    display: none;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 22px;
    color: var(--error-text);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
    animation: fadeIn 0.3s ease;
}

.auth-error-banner.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error-highlight);
    flex-shrink: 0;
}

.error-banner-text {
    flex: 1;
    line-height: 1.35;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: #57534e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #ffffff;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(199, 56, 12, 0.15);
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 500;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

/* Input Error State */
.input-wrapper.input-error,
input.input-error {
    border-color: var(--error-highlight) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* Password Toggle */
.password-wrapper {
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f4;
    color: #57534e;
    border: 1px solid #d6d3d1;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    background: #e7e5e4;
    color: var(--text-primary);
    border-color: #a8a29e;
}

/* Error Field Messages */
.error-message {
    display: block;
    color: var(--error-highlight);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
    min-height: 16px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #57534e;
    font-weight: 500;
}

.checkbox-box {
    width: 16px;
    height: 16px;
    border: 1px solid #d6d3d1;
    border-radius: 3px;
    background: #ffffff;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-box::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box::after {
    opacity: 1;
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

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

/* Primary Submit Button */
.login-btn {
    width: 100%;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(199, 56, 12, 0.25);
}

.login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(199, 56, 12, 0.35);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(1px);
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loader-bar {
    width: 4px;
    height: 14px;
    background: #ffffff;
    animation: loaderPulse 1s ease-in-out infinite;
}

.loader-bar:nth-child(2) { animation-delay: 0.2s; }
.loader-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderPulse {
    0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    40% { transform: scaleY(1); opacity: 1; }
}

.login-btn.loading .btn-text { opacity: 0; }
.login-btn.loading .btn-loader { opacity: 1; }

/* Divider */
.divider {
    text-align: center;
    margin: 18px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
    transform: translateY(-50%);
}

.divider span {
    background: #FFF5F0;
    color: var(--text-muted);
    padding: 2px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
}

/* Social Buttons */
.social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.social-btn {
    flex: 1;
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: #f5f5f4;
    border-color: var(--accent);
    color: var(--accent);
}

/* Signup Link */
.signup-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.signup-link a {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 4px;
}

.signup-link a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Success Message */
.success-message {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 10px;
}

.success-message.visible,
.success-message.show {
    display: flex;
}

.success-icon {
    width: 48px;
    height: 48px;
    background: rgba(199, 56, 12, 0.1);
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.success-message h3 {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 4px;
}

.success-message p {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

/* Responsive Wall Adjustments */
@media (max-width: 1200px) {
    .wall-left { left: 15px; }
    .wall-right { right: 15px; }
    .wall-graphic svg { opacity: 0.4; }
}

@media (max-width: 900px) {
    .wall-graphic { display: none; }
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
        border-radius: 12px;
    }

    .login-header h2 {
        font-size: 28px;
    }
}
