/* Keycloak Theme Styles for TerraCloudRealm */

:root {
    --color-primary: #358032; 
    --color-secondary: #334681; 
    --color-bg-light: #f7f9fb;
    --color-border: #e2e8f0;
    --color-text-muted: #64748b;
    --color-text-dark: #1e293b;
}

/* 1. Base Reset and Typography */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--color-text-dark);
}

/* 2. Logo Header */
#kc-header-wrapper {
    display: block !important; 
    text-indent: -9999px;
    width: 280px; 
    height: 100px; 
    margin: 0 auto 20px; 
    background: url('../img/TerraTeq.png') no-repeat center;
    background-size: contain;
}

#kc-header {
    margin-bottom: 24px;
}

/* 3. Login Card */
#kc-content {
    background: white;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 40px;
    width: 550px;
    box-sizing: border-box;
}

#kc-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: #111;
}

/* 4. Form Styling & Spacing */
#kc-form-login > div {
    margin-bottom: 20px; /* Essential spacing between input groups */
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 8px;
}

input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

/* 5. Password Toggle FIX */
#kc-form-login div[dir="ltr"] {
    position: relative !important;
    display: block;
}

input[type="password"] {
    padding-right: 45px !important; /* Prevent text from hiding under the eye */
}

button[data-password-toggle] {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Fallback if your font-icons aren't loading */
button[data-password-toggle] i::before {
    content: '👁'; 
    font-style: normal;
    font-size: 1.1rem;
}

/* 6. Sign In Button */
#kc-login {
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

#kc-login:hover {
    background-color: #2b6528;
}

/* 7. Contact Sales Wrapper */
#contact-sales-wrapper {
    text-align: center;
    margin-top: 25px;
    padding-top: 10px;
    font-size: 0.9rem;
}

/* 8. Language Selector - Clean Inline Footer */
#kc-locale {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 15px;
    display: block !important;
}

#kc-current-locale-link {
    display: none !important; 
}

#kc-locale-dropdown ul {
    display: flex !important; 
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    position: static !important; 
    box-shadow: none !important;
}

#kc-locale-dropdown ul::before {
    content: "🌐 Language: ";
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-right: 8px;
}

#kc-locale-dropdown li a {
    text-decoration: none !important;
    color: var(--color-primary) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0 5px;
}

#kc-locale-dropdown li a:hover {
    text-decoration: underline !important;
}

#kc-locale-dropdown li:not(:last-child)::after {
    content: "|";
    margin-left: 10px;
    margin-right: 5px;
    color: var(--color-border);
}

/* 9. Copyright Footer */
.login-footer-copyright {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}


/* Contact Form Specifics */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(53, 128, 50, 0.1);
}

.muted-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.muted-link:hover {
    text-decoration: underline;
}

.success-msg {
    text-align: center;
    color: var(--color-primary);
    font-weight: 600;
    padding: 20px;
    border: 1px solid var(--color-primary);
    background: #f0fdf4;
    border-radius: 8px;
}

.primary-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 5px;
}