/* SIGMA Identity Server - Microsoft-inspired Clean Design */

:root {
    --primary-blue: #0078d4;
    --primary-green: #107c10;
    --white: #ffffff;
    --gray-50: #faf9f8;
    --gray-100: #f3f2f1;
    --gray-200: #edebe9;
    --gray-300: #e1dfdd;
    --gray-400: #d2d0ce;
    --gray-500: #8a8886;
    --gray-600: #605e5c;
    --gray-700: #484644;
    --gray-800: #323130;
    --gray-900: #201f1e;
    --red: #d13438;
    --green: #107c10;
    --border-radius: 2px;
    --box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    --box-shadow-elevated: 0 6px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.1s ease-in-out;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Center container for forms */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-elevated);
    width: 100%;
    max-width: 440px;
    padding: 44px 44px 36px;
}

.auth-header {
    text-align: left;
    margin-bottom: 36px;
}

.auth-logo {
    display: block;
    height: 40px;
    margin: 0 auto 24px auto;
    max-width: 200px;
    object-fit: contain;
}

.auth-logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    border-radius: 2px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 8px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

/*.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--white);
    transition: var(--transition);
    font-family: inherit;
}*/

.form-control {
    width: 100%;
    height: 37px;
    min-height: 37px;
    padding: 8px 12px;
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius);
    font-size: 16px;
    line-height: 1.4;
    background: var(--white);
    color: var(--gray-900, #111827);
    transition: var(--transition);
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* Ensure password fields have no decorations or reveal buttons */
/*.form-control[type="password"] {
    padding-right: 12px !important;
    background-image: none !important;
}*/

.form-control[type="password"] {
    height: 37px;
    min-height: 37px;
    padding-right: 12px !important;
    background-image: none !important;
}

/*.form-control[type="password"]::-webkit-textfield-decoration-container {
    display: none !important;
}*/

.form-control[type="password"]::-webkit-input-placeholder {
    color: var(--gray-500);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Hide Microsoft Edge / IE password reveal only */
.form-control[type="password"]::-ms-reveal,
.form-control[type="password"]::-ms-clear {
    display: none;
}

/* Optional: reduce Safari autofill/credential icon impact without destroying the input */
.form-control[type="password"]::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

/* Hide browser's default password reveal button completely */
/*.form-control[type="password"]::-ms-reveal,
.form-control[type="password"]::-ms-clear {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

.form-control[type="password"]::-webkit-credentials-auto-fill-button,
.form-control[type="password"]::-webkit-caps-lock-indicator {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    right: 0 !important;
    width: 0 !important;
    height: 0 !important;
}*/

/* Remove password toggle for all browsers */
/*input[type="password"] {
    -webkit-textfield-decoration-container: none !important;
}

input[type="password"]::-webkit-textfield-decoration-container {
    display: none !important;
}*/

.form-control.is-invalid {
    border-color: var(--red);
}

.form-check {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.form-check-input {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue);
}

.form-check-label {
    font-size: 14px;
    color: var(--gray-800);
    cursor: pointer;
    line-height: 1.4;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 20px 0;
    padding: 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-800);
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    margin-left: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    min-height: 32px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
    margin-top: 16px;
}

.btn-primary:hover:not(:disabled) {
    background-color: #106ebe;
    border-color: #106ebe;
    color: var(--white);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 15px;
    min-height: 36px;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.alert-danger {
    color: #c50e1f;
    background-color: #fde7e9;
    border-color: #f1aeb5;
}

.alert-success {
    color: var(--green);
    background-color: #dff6dd;
    border-color: #9fd89b;
}

.alert-info {
    color: #0078d4;
    background-color: #e1f5fe;
    border-color: #a6e1ff;
}

.text-danger {
    color: #c50e1f;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Success Icon Styles */
.success-icon {
    text-align: center;
    margin-bottom: 24px;
}

.success-checkmark {
    display: inline-block;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-green), #16aa16);
    border-radius: 50%;
    font-size: 32px;
    line-height: 64px;
    color: var(--white);
    font-weight: bold;
}

/* Footer */
.auth-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-footer p {
    font-size: 11px;
    color: var(--gray-500);
    opacity: 0.7;
    margin: 0;
}

.auth-footer-links {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.auth-footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
}

.auth-footer-links a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.auth-footer-text {
    color: var(--gray-500);
    font-size: 12px;
    margin: 0;
}

/* External Providers */
.external-providers {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.external-providers-title {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    text-align: center;
}

.external-provider {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--gray-800);
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
    text-align: center;
}

.external-provider:hover {
    background: var(--gray-50);
    text-decoration: none;
    color: var(--gray-800);
    border-color: var(--gray-500);
}

/* Tenant Selection */
.tenant-selection {
    margin-top: 24px;
}

.tenant-item {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--gray-800);
    transition: var(--transition);
}

.tenant-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-500);
    text-decoration: none;
    color: var(--gray-800);
}

.tenant-item.selected {
    background: #e1f5fe;
    border-color: var(--primary-blue);
}

.tenant-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.tenant-domain {
    font-size: 13px;
    color: var(--gray-600);
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
        margin: 1rem;
    }
    
    .auth-footer-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--gray-600); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Loading spinner */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Onboarding Styles */
.otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.password-requirements {
    margin-top: 8px;
}

.password-rules {
    margin: 8px 0 0 0;
    padding-left: 20px;
    list-style: none;
}

.password-rules li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 4px;
    color: var(--gray-500);
    font-size: 13px;
    transition: var(--transition);
}

.password-rules li::before {
    content: "○";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-weight: 400;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link:disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}
