/* ================================
   Login Page - Psikokey Design
   Psikocheckup 2026
   ================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --primary-color: #fb5373;
    --primary-light: #ff7a93;
    --primary-dark: #e43d5d;
    --text-dark: #2d2d2d;
    --text-light: #666666;
    --bg-light: #f8f9fc;
    --bg-white: #ffffff;
}

/* Reset - Important for login page isolation */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.login-body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #ffe5ec;
    background: linear-gradient(180deg, #fff5f7 0%, #ffeaef 30%, #ffd9e2 60%, #ffc8d4 100%);
    overflow: hidden;
    display: block;
    position: relative;
}

/* ================================
   Main Wrapper - Fixed viewport layout
   ================================ */
.login-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 40px;
    overflow: hidden;
}

.login-left {
    flex: 0 0 420px;
    width: 420px;
    max-width: 420px;
}

.login-right {
    flex: 0 1 auto;
    max-width: 600px;
    overflow: hidden;
}

.branding-container {
    max-width: 600px;
    text-align: center;
}

/* ================================
   Left Side - White Card with Form
   ================================ */
.login-form-container {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 40px 40px;
    width: 420px;
    max-width: 420px;
    box-shadow: 
        0 20px 60px rgba(251, 83, 115, 0.12),
        0 8px 25px rgba(0, 0, 0, 0.06);
    animation: slideInLeft 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo .logo-image {
    height: 80px;
    width: auto;
    object-fit: contain;
}

/* ================================
   Right Side - Branding
   ================================ */
.branding-container {
    animation: slideInRight 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.branding-container {
    text-align: center;
}

.psikokey-logo {
    width: min(520px, 40vw);
    max-width: 520px;
    max-height: 60vh;
    height: auto;
    margin-bottom: 25px;
    animation: fadeInScale 0.8s ease-out 0.3s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.branding-tagline {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-dark);
    font-style: italic;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Form Styles
   ================================ */
.login-form {
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label i {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 13px;
    width: 16px;
}

/* DevExtreme TextBox */
.dx-texteditor {
    border-radius: 10px !important;
    background: #faf7f8 !important;
    border: 1px solid #f0e8ea !important;
    transition: all 0.3s ease !important;
}

.dx-texteditor:hover {
    background: #f5f0f2 !important;
    border-color: #e8dfe1 !important;
}

.dx-texteditor.dx-state-focused {
    background: var(--bg-white) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(251, 83, 115, 0.1) !important;
}

.dx-texteditor-input {
    color: var(--text-dark) !important;
    font-size: 14px !important;
    padding: 14px 16px !important;
    font-weight: 500 !important;
    font-style: normal !important;
}

/* Hide native placeholder */
.dx-texteditor-input::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.dx-placeholder {
    color: #b0a5a8 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-size: 14px !important;
    pointer-events: none;
}

.dx-placeholder::before {
    color: #b0a5a8 !important;
    font-weight: 400 !important;
    font-style: normal !important;
    padding: 14px 16px !important;
}

.dx-texteditor.dx-state-focused .dx-placeholder,
.dx-texteditor:not(.dx-texteditor-empty) .dx-placeholder {
    display: none !important;
}

.dx-textbox-container {
    height: 48px !important;
}

/* Password Toggle Button */
.dx-texteditor-buttons-container .dx-button {
    background: transparent !important;
    border: none !important;
    margin-right: 4px;
}

.dx-texteditor-buttons-container .dx-button .dx-icon {
    color: var(--primary-color) !important;
    font-size: 18px !important;
}

.dx-texteditor-buttons-container .dx-button:hover .dx-icon {
    color: var(--primary-dark) !important;
}

/* CheckBox */
#rememberMe {
    margin-top: 5px;
}

.dx-checkbox-icon {
    border-color: #e0d8da !important;
    background: #faf7f8 !important;
    border-radius: 5px !important;
    border-width: 2px !important;
}

.dx-checkbox-checked .dx-checkbox-icon {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.dx-checkbox-text {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* Login Button */
.dx-button.dx-button-success {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease !important;
    box-shadow: 0 6px 20px rgba(251, 83, 115, 0.35) !important;
    position: relative;
    overflow: hidden;
}

.dx-button.dx-button-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.dx-button.dx-button-success:hover::before {
    left: 100%;
}

.dx-button.dx-button-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(251, 83, 115, 0.4) !important;
}

.dx-button.dx-button-success:active {
    transform: translateY(0);
}

.dx-button-content {
    padding: 14px 24px !important;
}

/* ================================
   Error Message Card
   ================================ */
.login-error-container {
    margin-bottom: 25px;
    animation: slideDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-error-container.dismissing {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}

.login-error-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(251, 83, 115, 0.08);
    border: 1px solid rgba(251, 83, 115, 0.2);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.login-error-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 8px;
}

.login-error-icon i {
    font-size: 16px;
    color: white;
}

.login-error-content {
    flex: 1;
    min-width: 0;
}

.login-error-title {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
}

.login-error-message {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.login-error-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-error-close:hover {
    background: rgba(251, 83, 115, 0.1);
    color: var(--primary-color);
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.login-form.shake {
    animation: shake 0.5s ease-in-out;
}

/* ================================
   Footer
   ================================ */
.form-footer {
    text-align: center;
    margin-top: 12px;
}

.forgot-password {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.forgot-password:hover {
    color: var(--primary-color);
}

.forgot-password i {
    font-size: 12px;
}

.login-test-code-link:hover {
    background: rgba(251, 83, 115, 0.06) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0e8ea;
}

.login-info {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.login-info i {
    margin-right: 5px;
    color: var(--primary-color);
}

.login-info strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Copyright */
.copyright-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 12px;
    background: transparent;
    z-index: 100;
}

.copyright-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 1200px) {
    .login-wrapper {
        gap: 60px;
    }
    
    .psikokey-logo {
        max-width: 450px;
    }
    
    .branding-tagline {
        font-size: 20px;
    }
}

@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 40px;
        padding: 40px 20px 60px;
        overflow-y: auto;
    }

    body.login-body {
        overflow-y: auto;
    }

    .login-form-container {
        width: 100%;
        max-width: 420px;
    }
    
    .psikokey-logo {
        width: min(360px, 70vw);
        max-width: 360px;
        max-height: 40vh;
    }
    
    .branding-tagline {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .login-wrapper {
        padding: 30px 15px 40px;
        gap: 30px;
    }
    
    .login-form-container {
        padding: 30px 25px;
        border-radius: 20px;
    }
    
    .login-logo .logo-image {
        height: 55px;
    }
    
    .psikokey-logo {
        max-width: 280px;
    }
    
    .branding-tagline {
        font-size: 16px;
    }
    
    .form-label {
        font-size: 11px;
    }
    
    .dx-texteditor-input {
        font-size: 14px !important;
        padding: 12px 14px !important;
    }
    
    .dx-textbox-container {
        height: 44px !important;
    }
    
    .dx-placeholder::before {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
    
    .dx-button-content {
        padding: 12px 20px !important;
    }
    
    .copyright-footer {
        position: relative;
        padding: 15px;
    }
}

/* Large Desktop Screens (1400px+) */
@media (min-width: 1400px) {
    .login-wrapper {
        gap: 100px;
    }
    
    .login-form-container {
        padding: 50px 50px;
        width: 450px;
    }
    
    .psikokey-logo {
        max-width: 600px;
    }
}

/* Very Large Screens (1800px+) */
@media (min-width: 1800px) {
    .login-wrapper {
        gap: 150px;
    }
    
    .login-form-container {
        width: 480px;
        padding: 55px 55px;
    }
    
    .psikokey-logo {
        max-width: 700px;
    }
    
    .branding-tagline {
        font-size: 26px;
    }
}

/* DevExtreme Toast */
.dx-toast {
    border-radius: 10px !important;
}

.dx-toast-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
}

.dx-toast-error {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
}

.dx-toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%) !important;
}

.dx-toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
}

.dx-toast-content {
    padding: 12px 18px !important;
    font-weight: 500 !important;
}
