/**
 * Header Login Overlay Styles
 *
 * @package Incuimprovements
 * @since 2.1.0
 */

/* Overlay Container */
.incuimprovements-login-header-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    background-color: transparent;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none; /* Allow clicks through transparent parts */
}

.incuimprovements-login-header-overlay * {
    pointer-events: auto; /* Re-enable clicks on actual content */
}

/* Container that holds X + form */
.header-login-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 300px;
    width: 100%;
    background-color: #ffffff;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-sizing: border-box;
}

/* Close Button */
.header-login-close {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: none;
    background: transparent;
    color: #333333;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-login-close:hover {
    color: #000000;
    transform: scale(1.1);
}

/* Login Form */
.header-login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin: 0;
}

/* Form Fields Container */
.header-login-fields {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
}

/* Layout: Inline (horizontal fields) */
[data-layout="inline"] .header-login-fields {
    flex-direction: row;
}

[data-layout="inline"] .header-login-container {
    flex-direction: row;
}

/* Layout: Inline without close button - collapse to just the form */
[data-layout="inline"][data-show-close="no"] .header-login-container,
[data-layout="inline"][data-show-close=""] .header-login-container {
    gap: 0;
}

[data-layout="inline"][data-show-close="no"] .header-login-form,
[data-layout="inline"][data-show-close=""] .header-login-form {
    width: 100%;
}

/* Layout: Dropdown (stacked fields) */
[data-layout="dropdown"] .header-login-fields {
    flex-direction: column;
    align-items: stretch;
}

[data-layout="dropdown"] .header-login-container {
    flex-direction: column;
    align-items: stretch;
}

[data-layout="dropdown"] .header-login-close {
    align-self: flex-start;
    margin-bottom: 0;
}

[data-layout="dropdown"] .header-login-input {
    width: 100%;
}

[data-layout="dropdown"] .header-login-submit {
    width: 100%;
}

/* Dropdown without close button - collapse gap */
[data-layout="dropdown"][data-show-close="no"] .header-login-container,
[data-layout="dropdown"][data-show-close=""] .header-login-container {
    gap: 0;
}

/* Input Fields */
.header-login-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.header-login-input:focus {
    outline: none;
    border-color: #0073aa;
}

.header-login-input::placeholder {
    color: #999;
}

/* Submit Button */
.header-login-submit {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: none;
    background-color: #0073aa;
    color: #ffffff;
    font-size: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.header-login-submit:hover {
    background-color: #005177;
    transform: scale(1.05);
}

.header-login-submit:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Links Container */
.header-login-links {
    text-align: center;
    margin: 8px 0 0 0;
}

.header-login-forgot {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.header-login-forgot:hover {
    color: #005177;
    text-decoration: underline;
}

/* Messages */
.header-login-messages {
    text-align: center;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin: 0;
}

.header-login-messages:not(:empty) {
    margin-top: 8px;
}

.header-login-messages.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.header-login-messages.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .incuimprovements-login-header-overlay {
        padding: 15px 20px;
    }

    .header-login-fields {
        flex-wrap: wrap;
    }

    .header-login-input {
        width: 100%;
        flex: 1 1 100%;
    }

    .header-login-submit {
        width: 100%;
        min-width: unset;
    }

    .header-login-close {
        left: 10px;
    }
}

/* Elementor Editor Preview */
.elementor-editor-active .incuimprovements-login-header-overlay {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: auto;
    min-height: 100px;
}
