/**
 * Login Modal Styles
 * Responsive CSS Grid layout matching Figma design
 * Base modal styles now in micromodal-base.css
 */

/* Login Modal Overlay - Higher z-index than other modals */
.login-modal__overlay {
    z-index: 1000015 !important;
}

/* Login Modal Container Specific Sizing */
.login-modal__container {
    max-width: 1200px;
}

/* Grid Layout */
.login-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}

/* Left Side - Form Section */
.login-form-section {
    padding: 48px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #FFFFFF;
}

/* Context Message */
.login-context-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FFF4E4;
    border: 1px solid #E5D5B7;
    border-radius: 8px;
    margin-bottom: 24px;
}

.login-context-message svg {
    flex-shrink: 0;
}

.context-message-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #343434;
}

/* Error Message Container */
.login-error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FEE;
    border: 1px solid #dc3545;
    border-radius: 8px;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

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

.login-error-message svg {
    flex-shrink: 0;
}

.error-message-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #dc3545;
    font-weight: 500;
}

/* OTP Field Styles */
.otp-field {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        margin-top: inherit;
    }
}

.otp-field .field-description {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    margin-top: 6px;
    margin-bottom: 0;
}

.otp-field input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5em;
    text-align: center;
}

/* Loading State for Submit Button */
.button-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button-loader svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Modal View Switching */
.modal-view {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-view.active {
    display: block;
    opacity: 1;
}

/* Close Button */
.login-modal__close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    z-index: 1000013;
}

.login-modal__close:hover {
    opacity: 0.7;
}

.login-modal__close svg {
    width: 24px;
    height: 24px;
}

/* Typography */
.modal-title {
    font-family: 'Kollektif', Georgia, serif;
    font-size: 48px;
    line-height: 1.5;
    color: #343434;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.modal-subtitle {
    font-family: 'Kollektif', Georgia, serif;
    font-size: 22px;
    line-height: 1.5;
    color: #343434;
    margin: 0 0 12px 0;
    font-weight: 400;
}

.modal-description {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.1;
    color: #828282;
    margin: 0 0 32px 0;
}

/* Form Styles */
.login-modal-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 320px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #1E1E1E;
    font-weight: 400;
}

.form-field .input {
    padding: 12px 16px;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1;
    color: #1E1E1E;
    background: #FFFFFF;
    transition: border-color 0.2s;
}

.form-field .input::placeholder {
    color: #B3B3B3;
}

.form-field .input:focus {
    outline: none;
    border-color: #343434;
}

/* Password Field with Toggle */
.password-field {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 0.7;
}

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
}

/* Primary Button */
.button-primary {
    padding: 12px;
    background: #343434;
    border: 1px solid #2C2C2C;
    border-radius: 8px;
    color: #F5F5F5;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
}

.button-primary:hover {
    background: #2C2C2C;
    transform: translateY(-1px);
}

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

/* Links */
.form-links {
    margin-top: -8px;
}

.text-link {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: #1E1E1E;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.text-link:hover {
    opacity: 0.7;
}

.register-link {
    margin-top: 8px;
}

/* Right Side - Image Section */
.login-image-section {
    position: relative;
    overflow: hidden;
    border-radius: 0 8px 8px 0;
}

.modal-background-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
}

/* Responsive Breakpoints */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .login-modal__container {
        width: 95%;
    }
    
    .login-modal-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .login-form-section {
        padding: 40px 32px;
    }
    
    .modal-title {
        font-size: 40px;
    }
    
    .modal-subtitle {
        font-size: 20px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .login-modal__container {
        width: 95%;
        max-height: 95vh;
    }
    
    .login-modal-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .login-form-section {
        padding: 32px 24px;
        order: 1;
    }
    
    .login-image-section {
        display: none;
    }
    
    .modal-title {
        font-size: 36px;
    }
    
    .modal-subtitle {
        font-size: 18px;
    }
    
    .modal-description {
        font-size: 13px;
    }
    
    .login-modal-form {
        max-width: 100%;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .login-form-section {
        padding: 24px 20px;
    }
    
    .modal-title {
        font-size: 32px;
    }
    
    .modal-subtitle {
        font-size: 16px;
    }
    
    .modal-description {
        font-size: 12px;
        margin-bottom: 24px;
    }
    
    .form-field label {
        font-size: 14px;
    }
    
    .form-field .input {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .button-primary {
        font-size: 14px;
        padding: 10px;
    }
    
    .text-link {
        font-size: 14px;
    }
}

/* High Resolution Displays */
@media (min-width: 1440px) {
    .login-modal__container {
        max-width: 1166px;
    }
}

/* Accessibility */
.login-modal__overlay:focus,
.login-modal__close:focus,
.password-toggle:focus {
    outline: 2px solid #343434;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .login-modal {
        display: none !important;
    }
}