/* ---------------------------------------------------------------------------
   CARD IN CLOUD - Login Page
   Professional Authentication Design
   --------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.page-wrapper {
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    background-image: url("/images/image4.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

button {
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

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

/* ---------------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------------- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: transparent;
    position: relative;
}

.page-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.4); /* clearer background, no blur */
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .page-wrapper::before {
    background: rgba(10, 15, 25, 0.6); /* clear dark background */
}

.container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1100px;

    /* Fast Solid Core Instead of Glassmorphism */
    background: var(--surface);
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-sm);

    overflow: hidden;
    min-height: 600px;
    position: relative;
    z-index: 2;
    /* Fixed Performance Issue: Replaced `transition: all` with transform offloading */
    transform: translateZ(0); 
    will-change: transform, box-shadow;
}

/* Responsive fix for all screen sizes */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        border-radius: var(--radius-xl);
    }
}

/* ---------------------------------------------------------------------------
   FORM SIDE
   --------------------------------------------------------------------------- */
.form-side {
    flex: 1;
    padding: clamp(2rem, 8vw, 84px); /* Fixed fluid padding limits */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Rely on container glass */
}

.form-content {
    width: 100%;
    max-width: 420px;
}

/* ---------------------------------------------------------------------------
   TYPOGRAPHY
   --------------------------------------------------------------------------- */
.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    max-height: 28px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-weight: 400;
}

.footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: var(--space-xl);
}

/* ---------------------------------------------------------------------------
   FORM INPUTS
   --------------------------------------------------------------------------- */
.input-group {
    margin-bottom: var(--space-lg);
    position: relative;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    opacity: 0;
}

.input-group:nth-child(1) { animation-delay: 0.1s; }
.input-group:nth-child(2) { animation-delay: 0.2s; }
.input-group:nth-child(3) { animation-delay: 0.3s; }
.input-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    color: var(--gray-900);

    /* Modern Solid/Subtle input */
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    display: block;
    appearance: none;
}

.input-field::placeholder {
    color: var(--gray-400);
}

.input-field:hover {
    border-color: var(--gray-300);
}

.input-field:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-outline);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.input-field.password {
    padding-right: 56px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s ease;
    font-size: 1rem;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.password-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Hide browser password reveals */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
}

/* Auto-fill Styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--gray-900) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--white) inset !important;
    box-shadow: 0 0 0 1000px var(--white) inset !important;
    background-color: var(--white) !important;
    border: 2px solid var(--gray-200) !important;
    transition: background-color 5000s ease-in-out 0s;
}

input:-webkit-autofill:focus {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 0 4px var(--focus-outline), 0 0 0 1000px var(--white) inset !important;
}

/* Validation */
.input-error {
    display: block;
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: var(--space-sm);
    font-weight: 500;
}

.validation-errors {
    padding: var(--space-md);
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

/* ---------------------------------------------------------------------------
   BUTTONS & FORM OPTIONS
   --------------------------------------------------------------------------- */
.btn {
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: var(--radius-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

/* Internal sheen for Apple-like detail */
.btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm); 
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

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

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
}

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

.checkbox-input {
    width: 18px;
    height: 18px;
    margin-right: var(--space-sm);
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.link-primary {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.15s ease;
}

.link-primary:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   DIVIDER
   --------------------------------------------------------------------------- */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-xl) 0;
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider::before {
    margin-right: var(--space-md);
}

.divider::after {
    margin-left: var(--space-md);
}

/* ---------------------------------------------------------------------------
   SOCIAL BUTTON
   --------------------------------------------------------------------------- */
.social-button {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
}

.social-button:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.social-button:active {
    transform: translateY(1px);
}

.social-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.social-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   INFO SIDE (Right Panel)
   --------------------------------------------------------------------------- */
.info-side {
    flex: 1;
    color: var(--white);
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: visible;
    background: var(--brand-gradient);
    isolation: isolate;
    transform: translateZ(0);
}

/* Hexagon Pattern Overlay */
.info-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background-size: 42px 75px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23ffffff' stroke-width='2' stroke-opacity='0.27'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.info-content {
    max-width: 420px;
    position: relative;
    z-index: 2;
}

.info-logo {
    display: block;
    width: 120px;
    max-width: 40%;
    height: auto;
    margin: 0 0 1.5rem 0;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.info-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    line-height: 1.3;
    color: var(--white);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.info-description {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

/* Accent Glow */
/*.gold-accent {
    position: absolute;
    left: 60px;
    top: -20px;
    width: 250px;
    height: 200px;
    background: linear-gradient(to bottom, rgba(6, 182, 212, 0.08) 0%, transparent 80%);
    clip-path: polygon(40% 0%, 60% 0%, 100% 100%, 0% 100%);
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}*/

/* ---------------------------------------------------------------------------
   ANIMATED CARD
   --------------------------------------------------------------------------- */
/* Floating Card Animation */
.ecard-mockup {
    width: 320px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    transform: rotate(-10deg);
    animation: floatCard 8s ease-in-out infinite;
    position: relative;
    z-index: 10;
    margin: calc(var(--space-xl) + 24px) auto 0; /* Pushed down by 20px to prevent text overlap */
}

.theme-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-switcher .dark-icon {
    display: none;
}

[data-theme="light"] .theme-switcher .light-icon {
    display: none;
}

.ecard-chip {
    width: 44px;
    height: 32px;
    background: linear-gradient(135deg, var(--background-light), var(--border-medium));
    border-radius: 6px;
    margin-bottom: 24px;
}

.ecard-text-line {
    height: 10px;
    background: rgba(var(--white-rgb), 0.45);
    border-radius: 5px;
    margin-bottom: 10px;
    width: 75%;
}

.ecard-text-line-short {
    width: 50%;
}

.ecard-nfc-icon {
    position: absolute;
    bottom: 25px;
    right: 25px;
    color: var(--text-light);
    opacity: 0.8;
    font-size: 1.5rem;
    transform: rotate(90deg);
}

@keyframes floatCard {
    0%, 100% {
        transform: rotate(-10deg) translateY(0);
    }
    50% {
        transform: rotate(-10deg) translateY(-20px);
    }
}

/* ---------------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        max-width: 680px;
    }

    .form-side, .info-side {
        flex: none;
        width: 100%;
    }

    .info-side {
        min-height: 400px;
    }

    .info-logo {
        width: 120px;
        max-width: 34%;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 0;
        background: var(--surface);
    }

    .container {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .form-side {
        padding: var(--space-2xl) var(--space-lg);
        background: var(--surface);
        align-items: flex-start;
    }

    .form-content {
        margin: 0 auto;
    }

    .info-side {
        display: none;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        background: url("/images/image4.png") center/cover fixed;
        align-items: flex-end; /* Align bottom for sheet effect */
        padding: 0;
    }

    .form-side {
        padding: var(--space-xl) var(--space-md);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: var(--space-xl);
        background: var(--surface);
        border-radius: 24px 24px 0 0; /* Bottom sheet curve */
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        position: relative;
        animation: slideUpSheet 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Swipe Indicator */
    .form-side::before {
        content: "";
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: var(--gray-300);
        border-radius: 10px;
    }

    @keyframes slideUpSheet {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .logo {
        font-size: 1.25rem;
        margin-bottom: var(--space-xl);
        justify-content: center;
    }

    .page-title {
        font-size: 1.6rem;
        text-align: center;
    }

    .page-subtitle {
        text-align: center;
        margin-bottom: var(--space-xl);
    }

    .input-field {
        padding: 0.85rem 1rem;
        border-radius: var(--radius-md);
    }

    .btn {
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
    }

    .form-options {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .info-logo {
        width: 100px;
        max-width: 46%;
    }

    .divider {
        margin: var(--space-lg) 0;
    }
}



