﻿/* =========================================================
   DoohClick AuthServer – Pixel-perfect Metronic/Angular match
   Base font-size: 13px (matching Metronic theme7)
   so 1rem = 13px, all rem values match Angular exactly.
   Colors & metrics taken from Angular computed styles:
     Primary:   #75c3bc  (teal/mint)
     Text:      #243843  (dark teal)
     Body bg:   #f5f8fa
     Input bg:  #eef3f7  (form-control-solid)
     Card:      white, shadow-sm, 0.475rem radius
     Font:      Inter
   ========================================================= */

:root {
    --dc-bg: #f5f8fa;
    --dc-card: #ffffff;
    --dc-text: #243843;
    --dc-subtle: #5e6278;
    --dc-primary: #75c3bc;
    --dc-primary-hover: #5fb5ad;
    --dc-input-bg: #eef3f7;
    --dc-danger-bg: #fff0f0;
    --dc-danger-text: #8e1f2c;
    --dc-success-bg: #f0fdf4;
    --dc-success-text: #166534;
    --dc-gray-200: #eff2f5;
    --dc-gray-300: #e4e6ef;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-size: 13px !important;
    font-family: Inter, Helvetica, "sans-serif";
    background: var(--dc-bg);
    color: var(--dc-text);
}

/* ---- page wrapper ---- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: var(--dc-bg);
}

/* ---- logo (outside card) ---- */
.auth-logo-link {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem; /* mb-12 */
}

.auth-logo {
    height: 40px;
}

/* ---- card ---- */
.auth-card {
    width: 100%;
    max-width: 500px;
    border-radius: 0.475rem;
    background: var(--dc-card);
    box-shadow: 0 0.1rem 1rem 0.25rem rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
}

/* ---- tenant change bar ---- */
.tenant-change-bar {
    text-align: center;
    font-size: 1.075rem;
    color: var(--dc-text);
    margin-bottom: 0;
}

.tenant-change-bar a {
    color: var(--dc-primary);
    text-decoration: none;
    cursor: pointer;
}

.tenant-change-bar a:hover {
    text-decoration: underline;
}

.tenant-separator {
    border: none;
    border-top: 1px solid var(--dc-gray-300);
    margin: 1.54rem 4.6rem; /* mx-15 in Metronic */
}

/* ---- header ---- */
.auth-header {
    text-align: center;
}

.auth-header h1 {
    margin: 0 0 1.54rem;
    color: var(--dc-text);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.auth-header p {
    margin: 0 0 1.54rem;
    color: var(--dc-subtle);
    font-size: 1.075rem;
}

/* ---- alerts ---- */
.auth-error {
    border: 1px solid #ffd7db;
    border-radius: 0.475rem;
    background: var(--dc-danger-bg);
    color: var(--dc-danger-text);
    padding: 0.75rem 0.925rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.auth-success {
    border: 1px solid #bbf7d0;
    border-radius: 0.475rem;
    background: var(--dc-success-bg);
    color: var(--dc-success-text);
    padding: 0.75rem 0.925rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

/* ---- form ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form label:not(.form-check):not(.tenant-modal-label) {
    display: none;
}

/* ---- input group (icon + input) ---- */
.auth-input-group {
    display: flex;
    align-items: stretch;
    border-radius: 0.475rem;
    overflow: hidden;
}

/* when the group contains a password toggle, remove the right radius from the input */
.auth-input-group.has-password-toggle input {
    border-radius: 0;
}

/* hide the browser's own password reveal / clear control (Edge) — the group provides its own
   show/hide toggle, otherwise two eye icons show up once the field has a value */
.auth-input-group.has-password-toggle input::-ms-reveal,
.auth-input-group.has-password-toggle input::-ms-clear {
    display: none;
}

.auth-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.385rem;
    flex-shrink: 0;
    background: var(--dc-input-bg);
    color: var(--dc-subtle);
    font-size: 1.075rem;
    border: 1px solid var(--dc-input-bg);
    border-left: none;
    border-radius: 0 0.475rem 0.475rem 0;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: color 0.2s ease;
}

.auth-password-toggle:hover {
    color: var(--dc-primary);
}

.auth-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.385rem;
    flex-shrink: 0;
    background: var(--dc-input-bg);
    color: var(--dc-subtle);
    font-size: 1.075rem;
    border: 1px solid var(--dc-input-bg);
    border-right: none;
    border-radius: 0.475rem 0 0 0.475rem;
}

.auth-input-group input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--dc-input-bg);
    border-left: none;
    border-radius: 0 0.475rem 0.475rem 0;
    background: var(--dc-input-bg);
    color: var(--dc-text);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    height: 4.3rem;
    padding: 1.25rem 1.54rem 1.25rem 0.75rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-group input:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(117, 195, 188, 0.2);
}

.auth-input-group input:focus ~ .auth-input-icon,
.auth-input-group:focus-within .auth-input-icon {
    border-color: var(--dc-primary);
}

/* standalone inputs (no icon group) */
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    border: 1px solid var(--dc-input-bg);
    border-radius: 0.475rem;
    height: 4.3rem;
    padding: 1.25rem 1.54rem;
    color: var(--dc-text);
    background: var(--dc-input-bg);
    outline: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="email"]:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(117, 195, 188, 0.2);
}

/* ---- options row ---- */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
}

/* ---- Metronic form-check-custom form-check-solid ---- */
.form-check {
    display: flex;
    align-items: center;
    min-height: 0;
    padding-left: 0;
}

.form-check-custom {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin: 0;
}

.form-check-custom .form-check-input {
    float: none;
    flex-shrink: 0;
    margin-top: 0;
    margin-right: 0.615rem;
    margin-left: 0;
}

.form-check-solid .form-check-input {
    border: 0;
    background-color: var(--dc-gray-200);
}

.form-check-input {
    width: 1.75rem;
    height: 1.75rem;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--dc-gray-300);
    border-radius: 0.45em;
    background-color: var(--dc-card);
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.form-check-solid .form-check-input {
    border: 0;
    background-color: var(--dc-gray-200);
}

.form-check-input:checked {
    background-color: var(--dc-primary);
    border-color: var(--dc-primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' width='13' height='11' fill='none'%3e%3cpath d='M11.0426 1.02893C11.3258 0.695792 11.8254 0.655283 12.1585 0.938451C12.4917 1.22162 12.5322 1.72124 12.249 2.05437L5.51985 9.97104C5.23224 10.3094 4.72261 10.3451 4.3907 10.0513L0.828197 6.88439C0.50141 6.59498 0.471975 6.09454 0.76139 5.76775C1.05081 5.44096 1.55125 5.41153 1.87804 5.70094L4.83557 8.32352L11.0426 1.02893Z' fill='%23ffffff'/%3e%3c/svg%3e");
}

.form-check-label {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--dc-text);
    cursor: pointer;
    user-select: none;
}

/* ---- Form switch (toggle) ---- */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.75rem;
    border-radius: 1rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23b5b5c3'/%3e%3c/svg%3e");
    background-position: left center;
    background-size: contain;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    background-color: var(--dc-primary);
}

/* ---- links ---- */
.auth-link {
    color: var(--dc-primary);
    font-size: 1.1rem;
    text-decoration: none;
    font-weight: 400;
}

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

.pipe-divider {
    margin: 0 0.3rem;
    color: var(--dc-gray-300);
}

/* ---- submit button ---- */
.auth-form button[type="submit"] {
    height: 3.6rem;
    border: none;
    border-radius: 0.475rem;
    background: var(--dc-primary);
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.auth-form button[type="submit"]:hover {
    background: var(--dc-primary-hover);
}

.auth-form button[type="submit"]:active {
    transform: translateY(1px);
}

.auth-form button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-form button[type="submit"]:disabled:hover {
    background: var(--dc-primary);
}

/* ---- external login button ---- */
.auth-btn-external {
    height: 3.6rem;
    border: 1px solid var(--dc-input-bg);
    border-radius: 0.475rem;
    background: var(--dc-card);
    color: var(--dc-text);
    font-size: 1.075rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-btn-external:hover {
    background: var(--dc-bg);
    border-color: var(--dc-primary);
}

/* ---- divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.925rem;
    margin: 1.385rem 0;
    color: var(--dc-subtle);
    font-size: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--dc-gray-300);
}

/* ---- footer (inside card) ---- */
.auth-footer {
    margin-top: 1.54rem;
    text-align: center;
    font-size: 1.1rem;
}

.auth-footer-cols {
    display: flex;
    justify-content: space-around;
    gap: 1.25rem;
    text-align: center;
}

.auth-footer-col {
    flex: 1;
}

.auth-footer-label {
    margin-bottom: 0.615rem;
    color: var(--dc-text);
    font-size: 1.1rem;
}

/* ---- language flags footer (outside card) ---- */
.auth-lang-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 3rem;
    padding: 0;
}

.lang-flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.3rem;
    cursor: pointer;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.lang-flag-btn:hover {
    opacity: 1;
}

/* ---- tenant change modal ---- */
.tenant-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6.15rem;
}

.tenant-modal-dialog {
    background: var(--dc-card);
    border-radius: 0.475rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.tenant-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.85rem;
    border-bottom: 1px solid var(--dc-gray-300);
}

.tenant-modal-header h5 {
    margin: 0;
    font-size: 1.23rem;
    font-weight: 600;
    color: var(--dc-text);
}

.tenant-modal-close {
    border: none;
    background: none;
    font-size: 1.85rem;
    color: var(--dc-subtle);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tenant-modal-close:hover {
    color: var(--dc-text);
}

.tenant-modal-body {
    padding: 1.54rem 1.85rem;
}

.tenant-modal-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
}

.tenant-modal-row:last-child {
    margin-bottom: 0;
}

.tenant-modal-label {
    width: 10.75rem;
    flex-shrink: 0;
    font-size: 1.075rem;
    font-weight: 500;
    color: var(--dc-text);
}

.tenant-modal-toggle-wrap {
    flex: 1;
}

.tenant-modal-input-wrap {
    flex: 1;
}

.tenant-modal-input-wrap .form-control {
    width: 100%;
    border: 1px solid var(--dc-gray-300);
    border-radius: 0.475rem;
    height: 3.23rem;
    padding: 0.615rem 1.075rem;
    color: var(--dc-text);
    background: var(--dc-card);
    outline: none;
    font-family: inherit;
    font-size: 1.075rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tenant-modal-input-wrap .form-control:focus {
    border-color: var(--dc-primary);
    box-shadow: 0 0 0 3px rgba(117, 195, 188, 0.2);
}

.tenant-modal-input-wrap .form-control:disabled {
    background: var(--dc-gray-200);
    color: var(--dc-subtle);
}

.tenant-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.615rem;
    padding: 1.25rem 1.85rem;
    border-top: 1px solid var(--dc-gray-300);
}

.btn-modal-cancel {
    border: none;
    background: none;
    color: #f1416c;
    font-size: 1.075rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.615rem 1.25rem;
}

.btn-modal-cancel:hover {
    text-decoration: underline;
}

.btn-modal-save {
    border: none;
    background: none;
    color: #50cd89;
    font-size: 1.075rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.615rem 1.25rem;
}

.btn-modal-save:hover {
    text-decoration: underline;
}

/* ---- form row (register side-by-side) ---- */
.auth-form-row {
    display: flex;
    gap: 0.925rem;
}

.auth-form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.46rem;
}

/* ---- button row (Back + Submit side-by-side) ---- */
.auth-btn-row {
    display: flex;
    gap: 0.925rem;
    justify-content: center;
}

.auth-btn-row > * {
    flex: 1;
}

.auth-btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 3.6rem;
    border: none;
    border-radius: 0.475rem;
    background: var(--dc-input-bg);
    color: var(--dc-text);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.auth-btn-back:hover {
    background: var(--dc-gray-300);
}

.auth-btn-back:active {
    transform: translateY(1px);
}

/* ---- Tenant registration form styles ---- */
.auth-section-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin: 0.75rem 0 0.25rem 0;
}

.auth-hint {
    font-size: 0.78rem;
    color: #999;
    margin-top: -0.2rem;
}

.auth-field-error {
    display: none;
    font-size: 0.78rem;
    color: var(--dc-danger-text);
    margin-top: -0.2rem;
}

.auth-field-error.is-visible {
    display: block;
}

.auth-result-details {
    padding: 0 0.5rem;
}

.auth-result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-result-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.auth-result-list li:last-child {
    border-bottom: none;
}

.auth-result-label {
    color: #888;
    margin-right: 0.5rem;
}

.auth-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #8d6e00;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

}