/* Hockeynomani - Login Theme */
/* Moderno, pulito e professionale */

:root {
    --primary-color: #4169E1;
    --primary-hover: #3557C5;
    --background: #0F1419;
    --card-bg: #1A1F2E;
    --input-bg: #2A3142;
    --text-primary: #FFFFFF;
    --text-secondary: #A0AEC0;
    --border-color: #2D3748;
    --error-color: #FC8181;
    --success-color: #68D391;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #0F1419 0%, #1A1F2E 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#kc-container {
    width: 100%;
    max-width: 450px;
}

/* Language menu shared by login, reset, registration and OTP screens. */
.hn-locale {
    position: relative;
    width: max-content;
    margin: 0 0 12px auto;
    z-index: 5;
}

.hn-locale-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 91px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.hn-locale-trigger::-webkit-details-marker {
    display: none;
}

.hn-locale-trigger:hover,
.hn-locale[open] .hn-locale-trigger {
    border-color: var(--primary-color);
    background: var(--input-bg);
}

.hn-locale-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: var(--text-secondary);
    transition: transform .16s ease;
}

.hn-locale[open] .hn-locale-chevron {
    transform: rotate(180deg);
}

.hn-locale-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    min-width: 185px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .35);
}

.hn-locale-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.hn-locale-option:hover,
.hn-locale-option:focus-visible,
.hn-locale-option[aria-current="true"] {
    background: var(--input-bg);
    color: var(--text-primary);
}

.hn-locale-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 21px;
    width: 21px;
    height: 16px;
    font-size: 19px;
    line-height: 1;
}

.hn-locale-flag--it::before { content: "🇮🇹"; }
.hn-locale-flag--en::before { content: "🇬🇧"; }
.hn-locale-flag--es::before { content: "🇪🇸"; }
.hn-locale-flag--fr::before { content: "🇫🇷"; }
.hn-locale-flag--de::before { content: "🇩🇪"; }
.hn-locale-flag--ca {
    height: 14px;
    border-radius: 2px;
    background: repeating-linear-gradient(to bottom, #ffda2c 0 2px, #d21c32 2px 4px);
}

#kc-header {
    text-align: center;
    margin-bottom: 30px;
}

#kc-header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#kc-header-wrapper img {
    max-height: 120px;
    width: auto;
    filter: brightness(1.1);
}

#kc-form-wrapper {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

#kc-form h1,
#kc-form-options h1,
.kc-form-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

#kc-form-options p,
.instruction {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper > .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
}

.input-icon-wrapper > input[type="text"],
.input-icon-wrapper > input[type="email"],
.input-icon-wrapper > input[type="password"] {
    padding-left: 44px;
}

.input-icon-wrapper > .password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 7px;
    margin: 0;
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

.input-icon-wrapper > .password-toggle:hover {
    transform: translateY(-50%);
    background: var(--border-color);
    box-shadow: none;
}

.input-icon-wrapper:has(.password-toggle) > input {
    padding-right: 50px;
}

label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: var(--text-secondary);
}

button,
input[type="submit"],
.btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
}

button:active,
input[type="submit"]:active,
.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

#kc-form-options {
    margin-top: 20px;
    text-align: center;
}

#kc-form-options a,
.link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

#kc-form-options a:hover,
.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: rgba(252, 129, 129, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background: rgba(104, 211, 145, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(246, 173, 85, 0.1);
    border: 1px solid #F6AD55;
    color: #F6AD55;
}

.alert-info {
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid #63B3ED;
    color: #63B3ED);
}

#kc-info {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

#kc-info-wrapper {
    text-align: center;
}

#kc-info-wrapper p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
}

#kc-registration {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

#kc-registration span {
    color: var(--text-secondary);
    font-size: 14px;
}

#kc-registration a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
}

#kc-registration a:hover {
    text-decoration: underline;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

/* Password visibility toggle */
.pf-c-form-control-toggle-password {
    position: relative;
    display: flex;
    align-items: center;
}

.pf-c-form-control-toggle-password input {
    padding-right: 50px !important;
}

.pf-c-form-control-toggle-password button,
button.pf-c-button.pf-m-control {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.pf-c-form-control-toggle-password button:hover,
button.pf-c-button.pf-m-control:hover {
    color: var(--primary-color) !important;
    background: rgba(65, 105, 225, 0.1) !important;
    transform: translateY(-50%) !important;
    box-shadow: none !important;
    border-radius: 6px !important;
}

.pf-c-form-control-toggle-password button svg,
button.pf-c-button.pf-m-control svg {
    width: 20px !important;
    height: 20px !important;
}

/* Social providers - NASCOSTI */
#kc-social-providers {
    display: none !important;
}

/* Nascondo anche il link "Torna alla home" nel footer */
#kc-info,
#kc-info-wrapper {
    display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    #kc-form-wrapper {
        padding: 30px 20px;
    }
    
    h1, .kc-form-title {
        font-size: 20px;
    }
    
    button,
    input[type="submit"],
    .btn {
        padding: 12px 20px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* RIMUOVI INDICATORI DI ERRORE ROSSI TERRIFICANTI */
/* Nascondi gli indicatori di validazione nativi del browser */
input[aria-invalid="true"] {
    background-image: none !important;
    background-color: var(--input-bg) !important;
    border-color: var(--error-color) !important;
}

input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.1) !important;
}

/* Nascondi icone di errore del browser */
input::-webkit-validation-bubble-message,
input::-webkit-validation-bubble-top-outer-arrow,
input::-webkit-validation-bubble-top-inner-arrow {
    display: none !important;
}

/* Stile pulito per messaggi di errore */
.pf-c-form__helper-text.pf-m-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-weight: 400;
}
