/**
 * S4E Go — Login Styles
 * 
 * Estilo dark minimalista inspirado no InControl2.
 * Fundo preto puro, campos arredondados, sem labels.
 * @author  Vicente Antunes
 * @updated 2026-06-28
 */

/* ============================================
   AUTH LAYOUT
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d0d;
    position: relative;
}

/* ============================================
   AUTH CARD
   ============================================ */
.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   AUTH LOGO
   ============================================ */
.auth-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px auto 2.5rem;
}

.auth-logo img {
    width: 240px;
    height: auto;
}

/* ============================================
   AUTH FORM
   ============================================ */
.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.9rem 1.25rem;
    background: transparent;
    border: 1px solid #3a3a3a;
    border-radius: 28px;
    color: #ffffff;
    font-family: var(--s4e-font-family);
    font-size: 0.925rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.auth-form .form-control::placeholder {
    color: #6b6b6b;
}

.auth-form .form-control:focus {
    border-color: #07713B;
    background: rgba(7, 113, 59, 0.04);
    box-shadow:
        0 0 6px rgba(7, 113, 59, 0.3),
        0 0 16px rgba(7, 113, 59, 0.15),
        0 0 30px rgba(7, 113, 59, 0.08),
        inset 0 0 6px rgba(7, 113, 59, 0.08);
}

/* Input group — sem ícones inline */
.auth-form .input-group {
    position: relative;
}

.auth-form .input-icon {
    display: none;
}

.auth-form .input-group .form-control {
    padding-left: 1.25rem;
}

/* Toggle password */
.auth-form .toggle-password {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4a4a4a;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.auth-form .toggle-password:hover {
    color: #999999;
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */
.auth-forgot {
    text-align: center;
    margin: 1.25rem 0 1.75rem;
}

.auth-forgot a {
    color: #888888;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot a:hover {
    color: #07713B;
}

/* ============================================
   AUTH BUTTON
   ============================================ */
.auth-btn {
    width: 100%;
    padding: 0.9rem;
    background: #1a1a1a;
    color: #999999;
    border: 1px solid #2a2a2a;
    border-radius: 28px;
    font-family: var(--s4e-font-family);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn:hover {
    background: #222222;
    color: #cccccc;
    border-color: #3a3a3a;
}

.auth-btn:active {
    background: #151515;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #07713B;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.auth-btn.loading .spinner {
    display: inline-block;
}

.auth-btn.loading .btn-text {
    display: none;
}

/* ============================================
   AUTH ALERTS
   ============================================ */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-error {
    background: rgba(240, 68, 56, 0.08);
    border: 1px solid rgba(240, 68, 56, 0.2);
    color: #f87171;
}

.auth-alert-success {
    background: rgba(7, 113, 59, 0.08);
    border: 1px solid rgba(7, 113, 59, 0.2);
    color: #4ade80;
}

/* ============================================
   AUTH FOOTER
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: #333333;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* ============================================
   REMEMBER ME
   ============================================ */
.auth-remember {
    display: none;
}

/* ============================================
   ANIMATION
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ============================================
   USER PROFILE (Modules Page)
   ============================================ */
.auth-user-profile {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #2a2a2a;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.auth-user-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid #2a2a2a;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.75rem;
    color: #555555;
}

.auth-user-name {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.auth-user-role {
    color: #07713B;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================
   SELECT DROPDOWNS (Modules Page)
   ============================================ */
.auth-select-group {
    margin-bottom: 1rem;
}

.auth-select-label {
    display: block;
    color: #555555;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    padding-left: 1.25rem;
}

.auth-select {
    width: 100%;
    padding: 0.85rem 2.5rem 0.85rem 1.25rem;
    background: transparent;
    border: 1px solid #3a3a3a;
    border-radius: 28px;
    color: #ffffff;
    font-family: var(--s4e-font-family);
    font-size: 0.9rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
}

.auth-select:focus {
    border-color: #07713B;
    box-shadow:
        0 0 6px rgba(7, 113, 59, 0.3),
        0 0 16px rgba(7, 113, 59, 0.15),
        0 0 30px rgba(7, 113, 59, 0.08);
}

.auth-select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.5rem;
}

/* ============================================
   MODULES CARD (wider)
   ============================================ */
.auth-card--modules {
    max-width: 440px;
}

/* ============================================
   DIVIDER
   ============================================ */
.auth-divider {
    border: none;
    border-top: 1px solid #1f1f1f;
    margin: 1.5rem 0;
}

/* ============================================
   CUSTOM DROPDOWN — S4E
   ============================================ */
.s4e-dropdown {
    position: relative;
    width: 100%;
}

.s4e-dropdown-trigger {
    width: 100%;
    padding: 0.9rem 2.5rem 0.9rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2d2d2d;
    border-radius: 28px;
    color: #ffffff;
    font-family: var(--s4e-font-family);
    font-size: 0.925rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-sizing: border-box;
}

.s4e-dropdown-trigger:hover {
    border-color: #444444;
    background: rgba(255, 255, 255, 0.04);
}

.s4e-dropdown.is-open .s4e-dropdown-trigger,
.s4e-dropdown-trigger:focus {
    border-color: #12b76a;
    background: rgba(18, 183, 106, 0.02);
    box-shadow:
        0 0 6px rgba(18, 183, 106, 0.3),
        0 0 16px rgba(18, 183, 106, 0.15),
        0 0 30px rgba(18, 183, 106, 0.08);
}

.s4e-dropdown-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.s4e-dropdown-value--placeholder {
    color: #6b6b6b;
}

.s4e-dropdown-arrow {
    color: #666;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.s4e-dropdown.is-open .s4e-dropdown-arrow {
    transform: rotate(180deg);
}

/* Panel */
.s4e-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

.s4e-dropdown.is-open .s4e-dropdown-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Search */
.s4e-dropdown-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1f1f1f;
}

.s4e-dropdown-search i {
    color: #555;
    font-size: 0.8rem;
}

.s4e-dropdown-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--s4e-font-family);
    font-size: 0.85rem;
}

.s4e-dropdown-search input::placeholder {
    color: #555;
}

/* Options list */
.s4e-dropdown-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.s4e-dropdown-options::-webkit-scrollbar {
    width: 4px;
}

.s4e-dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.s4e-dropdown-options::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* Multi-select option (checkbox) */
label.s4e-dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

label.s4e-dropdown-option:hover {
    background: rgba(7, 113, 59, 0.08);
}

label.s4e-dropdown-option input[type="checkbox"] {
    display: none;
}

.s4e-check {
    width: 18px;
    height: 18px;
    border: 1.5px solid #3a3a3a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

label.s4e-dropdown-option input:checked ~ .s4e-check {
    background: #07713B;
    border-color: #07713B;
}

label.s4e-dropdown-option input:checked ~ .s4e-check::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.s4e-option-text {
    color: #ccc;
    font-size: 0.875rem;
}

label.s4e-dropdown-option:hover .s4e-option-text {
    color: #fff;
}

label.s4e-dropdown-option input:checked ~ .s4e-option-text {
    color: #fff;
    font-weight: 500;
}

/* "Todos" option separator */
.s4e-dropdown-option--all {
    border-bottom: 1px solid #1f1f1f;
    margin-bottom: 0.2rem;
}

/* ============================================
   MODULE OPTION (Single-select styled card)
   ============================================ */
.s4e-module-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.15rem;
    cursor: pointer;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, transform 0.15s ease;
    border-left: 3px solid transparent;
    margin: 0.25rem 0.5rem;
    border-radius: 8px;
}

.s4e-module-option:hover {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(var(--module-rgb, 18, 183, 106), 0.4);
    transform: translateX(2px);
}

.s4e-module-option.s4e-dropdown-option--active {
    background: rgba(var(--module-rgb, 18, 183, 106), 0.08);
    border-left-color: var(--module-color, #12b76a);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 0 12px rgba(var(--module-rgb, 18, 183, 106), 0.05);
}

.s4e-module-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(var(--module-rgb, 255, 255, 255), 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
}

.s4e-module-option:hover .s4e-module-icon {
    background: rgba(var(--module-rgb, 255, 255, 255), 0.15);
    transform: scale(1.05);
}

.s4e-module-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.s4e-module-abbrev {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b6b6b;
    line-height: 1;
    margin-bottom: 3px;
    transition: color 0.2s ease;
}

.s4e-module-option:hover .s4e-module-abbrev {
    color: #888;
}

.s4e-module-option.s4e-dropdown-option--active .s4e-module-abbrev {
    color: var(--module-color, #12b76a);
}

.s4e-module-name {
    font-size: 0.88rem;
    color: #a3a3a3;
    line-height: 1.2;
    transition: color 0.2s ease;
}

.s4e-module-option:hover .s4e-module-name,
.s4e-module-option.s4e-dropdown-option--active .s4e-module-name {
    color: #ffffff;
}

/* Trigger with module selected */
.s4e-trigger-module {
    display: flex;
    align-items: center;
    gap: 8px;
}

.s4e-trigger-abbrev {
    font-weight: 600;
    font-size: 0.88rem;
    color: #ffffff;
}

/* Button disabled state */
.auth-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .auth-card {
        margin: 1rem;
        padding: 2rem 1.25rem;
    }

    .auth-card--modules {
        max-width: 100%;
    }
}
