/* Base styles matching Old Republic Title */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #212529;
}

/* Header styling matching ORT brand */
.shell-header {
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 12px rgba(10, 26, 94, 0.3);
    position: relative;
    overflow: hidden;
}

.shell-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 2;
    margin: 3px 15px !important;
    padding: 10px 15px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 155px;
    height: 36px;
    background: transparent;
    fill: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
}

.logo svg {
    width: 100%;
    height: 100%;
}

.header-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
    /* Deep navy for headings */
}

.header-text p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 10px;
}

/* Loading container */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 40px auto;
    max-width: 600px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #546e7a;
    font-size: 16px;
    font-weight: 500;
}

/* Authentication container */
.auth-container {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    border-top: 4px solid #1976d2;
}

.auth-container h2 {
    color: var(--brand-primary);
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.auth-container p {
    color: #546e7a;
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.5;
}

/* Buttons matching ORT style */
.btn-primary {
    background: linear-gradient(90deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.btn-primary:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: var(--brand-secondary);
    border: 2px solid var(--brand-secondary);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--brand-secondary);
    color: white;
}

/* Error and success messages */
.error-message {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid #d32f2f;
    font-weight: 500;
}

.success-message {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid #4caf50;
    font-weight: 500;
}

/* Main application container */
.app-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 15px;
    padding: 0;
}

.microfrontend-container,
.microfrontend-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Controls section */
.controls {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid #e1f5fe;
}

.controls h3 {
    color: var(--brand-primary);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: 2px;
}

/* Form inputs */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #37474f;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
    background: white;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Auth section */
.auth-section {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border-radius: 8px;
    margin-bottom: 16px;
}

.auth-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info {
    color: var(--brand-primary);
    font-weight: 500;
    font-size: 14px;
}

/* Token status */
.token-status {
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.token-valid {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.token-expired {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #f57c00;
    border-left: 4px solid #ff9800;
}

/* Microfrontend container */
.microfrontend-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e1f5fe;
}

.microfrontend-header {
    background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 600;
}

.microfrontend-content {
    padding: 0;
}

/* Utility classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mb-16 {
    margin-bottom: 16px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-8 {
    gap: 8px;
}

/* Error state for microfrontend */
.microfrontend-error {
    color: #d32f2f;
    padding: 24px;
    border: 2px dashed #f44336;
    border-radius: 8px;
    text-align: center;
    background: #ffebee;
}

.microfrontend-error strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Responsive design */

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
