/* auth.css - Fixed Desktop Viewport */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #4a45b1;
    --accent-color: #ff6584;
    --text-color: #333;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --book-color: #f8f5ff;
    --paper-color: #fffcf2;
    --ink-color: #2d3561;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fa;
    color: var(--text-color);
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding: 20px;
    position: relative;
}

/* Clean Background */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(108, 99, 255, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 101, 132, 0.05) 0%, transparent 20%);
    z-index: 0;
}

/* Main Wrapper - Reduced size for better desktop view */
.auth-wrapper {
    position: relative;
    width: 800px;
    max-width: 90%;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    z-index: 1;
    min-height: 600px;
    max-height: 90vh;
    /* Tambahkan ini untuk memastikan konsistensi di Chrome */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Main Form Container - Adjusted padding */
.auth-main {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    overflow-y: auto;
    /* Tambahkan ini untuk Chrome */
    -webkit-flex: 1;
    flex: 1;
    -webkit-overflow-y: auto;
    overflow-y: auto;
}

/* Literary Side Panel - Reduced width and padding */
.auth-literary {
    width: 250px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* Tambahkan ini untuk Chrome */
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

/* Auth Header - Adjusted margins */
.auth-header {
    margin-bottom: 30px;
    position: relative;
    z-index: 3;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.auth-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.auth-header p {
    color: #666;
    font-size: 15px;
    max-width: 90%;
    line-height: 1.4;
}

.auth-literary .auth-header h2 {
    color: white;
}

.auth-literary .auth-header h2::after {
    background: white;
}

.auth-literary .auth-header p {
    color: rgba(255, 255, 255, 0.9);
}

/* Form Container - Adjusted positioning */
.form-container {
    position: relative;
    z-index: 3;
    width: 100%;
}

.form-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    transform: translateX(30px);
    /* Tambahkan ini untuk Chrome */
    -webkit-transform: translateX(30px);
    -webkit-transition: all 0.5s ease;
}

.form-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    /* Tambahkan ini untuk Chrome */
    -webkit-transform: translateX(0);
}

/* Form Groups - Reduced margins and padding */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: white;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

/* Session Info */
.session-info {
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(108, 99, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.session-info i {
    color: var(--primary-color);
    margin-top: 2px;
}

.session-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Literary Input Effects */
.form-group::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    z-index: 1;
}

.form-group:focus-within::before {
    width: 100%;
}

/* Role Selection - Reduced margins */
.role-selection {
    margin-bottom: 25px;
}

.role-selection h3 {
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--dark-color);
}

.role-options {
    display: flex;
    gap: 12px;
}

.role-option {
    flex: 1;
    padding: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    position: relative;
    overflow: hidden;
}

.role-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.role-option:hover::before {
    opacity: 0.05;
}

.role-option.selected {
    border-color: var(--primary-color);
    background: rgba(108, 99, 255, 0.05);
}

.role-option.selected::before {
    opacity: 0.1;
}

.role-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.role-option:hover i {
    transform: translateY(-3px);
}

.role-option h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
    position: relative;
    z-index: 1;
}

.role-option p {
    margin: 0;
    font-size: 12px;
    color: #666;
    position: relative;
    z-index: 1;
}

/* Buttons - Reduced padding and font size */
.btn-auth {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-auth:hover::before {
    left: 100%;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.btn-register {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-register:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Auth Toggle - Reduced font size */
.auth-toggle {
    text-align: center;
    margin-top: 16px;
    position: relative;
    z-index: 3;
}

.auth-toggle p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.auth-toggle button {
    background: none;
    border: none;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.auth-toggle button:hover {
    background: rgba(108, 99, 255, 0.1);
}

/* Alert - Reduced padding */
.alert {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    /* Tambahkan ini untuk Chrome */
    -webkit-animation: slideIn 0.5s ease;
    animation: slideIn 0.5s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 16px;
}

.alert.session-error {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

/* Literary Elements - Repositioned and resized */
.literary-elements {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 1;
}

.book-stack {
    display: flex;
    transform: rotate(-5deg);
    margin-bottom: 16px;
}

.book {
    width: 50px;
    height: 70px;
    background: var(--book-color);
    border-radius: 4px;
    position: relative;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    margin-right: -16px;
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.book:nth-child(1) {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    transform: rotate(-5deg) translateY(-4px);
    z-index: 3;
}

.book:nth-child(2) {
    background: linear-gradient(45deg, #a1c4fd, #c2e9fb);
    transform: rotate(-8deg) translateY(-2px);
    z-index: 2;
}

.book:nth-child(3) {
    background: linear-gradient(45deg, #d4fc79, #96e6a1);
    transform: rotate(-10deg);
    z-index: 1;
}

.book:hover {
    transform: translateY(-6px) rotate(0deg);
}

/* Paper Element - Repositioned and resized */
.paper-element {
    position: absolute;
    top: 50%;
    right: 25px;
    width: 70px;
    height: 90px;
    background: white;
    border-radius: 4px;
    transform: rotate(15deg);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
    z-index: 1;
}

.paper-element::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

/* Ink Element - Smaller and Repositioned */
.ink-element {
    position: absolute;
    top: 30%;
    right: 40px;
    width: 25px;
    height: 25px;
    background: var(--accent-color);
    border-radius: 50% 30% 60% 40%;
    opacity: 0.6;
    z-index: 0;
    animation: morph 15s ease-in-out infinite;
}

/* Animations */
@keyframes morph {
    0%, 100% { border-radius: 50% 30% 60% 40%; }
    25% { border-radius: 30% 60% 40% 50%; }
    50% { border-radius: 60% 40% 50% 30%; }
    75% { border-radius: 40% 50% 30% 60%; }
}

@keyframes slideIn {
    from { 
        transform: translateY(20px); 
        opacity: 0; 
        /* Tambahkan ini untuk Chrome */
        -webkit-transform: translateY(20px);
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
        /* Tambahkan ini untuk Chrome */
        -webkit-transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-wrapper {
        flex-direction: column;
        border-radius: 20px;
        max-width: 100%;
        min-height: auto;
        max-height: none;
    }
    
    .auth-literary {
        width: 100%;
        padding: 25px;
        min-height: 130px;
        order: 2;
    }
    
    .auth-main {
        width: 100%;
        padding: 30px 25px;
        order: 1;
    }
    
    .literary-elements {
        position: static;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 16px;
        margin-top: 16px;
    }
    
    .book-stack {
        transform: none;
        margin: 0;
    }
    
    .book {
        width: 35px;
        height: 50px;
        margin-right: -12px;
    }
    
    .paper-element {
        position: static;
        transform: none;
        width: 45px;
        height: 60px;
    }
    
    .ink-element {
        display: none;
    }
    
    .auth-header h2 {
        font-size: 26px;
    }
    
    .role-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .role-option {
        padding: 14px;
    }
    
    .form-slide {
        position: relative;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .form-slide.hidden {
        display: none;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .auth-wrapper {
        width: 90%;
        max-width: 90%;
    }
    
    .auth-literary {
        width: 220px;
        padding: 25px;
    }
    
    .auth-main {
        padding: 35px;
    }
    
    .literary-elements {
        bottom: 25px;
        right: 25px;
    }
    
    .book {
        width: 45px;
        height: 65px;
    }
    
    .paper-element {
        width: 60px;
        height: 80px;
    }
}

/* Large Desktop Responsive */
@media (min-width: 1200px) {
    .auth-wrapper {
        width: 750px;
    }
    
    .auth-literary {
        width: 230px;
    }
}