/* ==========================================================================
   HybridLogin Page Styles
   Following BEM-like naming conventions and CSS best practices
   ========================================================================== */

/* Base Overrides
   ========================================================================== */
body {
    background: url('../images/bg/noise.png');
}

/* Message Components
   Base message styling with modifier variants
   ========================================================================== */
.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: block;
}

.message--error {
    color: #d13438;
    background-color: #fde7e9;
}

.message--info {
    color: #0078d4;
    background-color: #e7f3ff;
}

/* Azure Login Container
   Container for Azure authentication UI
   ========================================================================== */
.azure-login-container {
    margin-top: 15px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Azure Sign-In Button
   Accessible styling following Microsoft UI guidelines
   - sufficient color contrast
   - clear focus ring for keyboard users
   - larger tap target and readable text
   - preserved visual affordances on hover/active
*/
.azure-signin-btn {
    /* Use inline-flex so the element sizes to content on small viewports but stays centered when capped by width */
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;

    /* sizing that remains usable on touch devices */
    width: 280px !important;
    max-width: 100% !important;
    height: 48px !important; /* slightly larger for easier tapping */
    padding: 0 16px !important;
    margin: 0 auto !important;
    float: none !important;

    /* Visual styling - high contrast text on brand blue */
    background: linear-gradient(135deg, #0078D4 0%, #005A9E 100%) !important; /* Microsoft blue gradient */
    color: #FFFFFF !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    text-decoration: none !important;

    /* Typography - readable and bold */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;

    /* Subtle elevation */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    transition: transform 120ms ease-in-out, box-shadow 120ms ease-in-out, background 120ms ease-in-out !important;
}

/* Icon spacing and sizing */
.azure-signin-btn img {
    height: 20px !important;
    width: auto !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important; /* gap handles spacing */
}

/* Hover and active states keep strong contrast */
.azure-signin-btn:hover,
.azure-signin-btn:active {
    background: linear-gradient(135deg, #106EBE 0%, #004b7a 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2) !important;
}

/* Focus styles - DO NOT remove focus outlines; use :focus-visible for keyboard users */
.azure-signin-btn:focus {
    outline: none !important;
}
.azure-signin-btn:focus-visible {
    /* Accessible focus ring with good contrast and visible for keyboard navigation */
    box-shadow: 0 0 0 4px rgba(0,120,212,0.22), 0 2px 6px rgba(0,0,0,0.18) !important;
    border-color: rgba(255,255,255,0.6) !important;
}

/* Disabled state */
.azure-signin-btn[disabled],
.azure-signin-btn.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Ensure focus-visible polyfill users still get an outline */
.azure-signin-btn:focus:not(:focus-visible) {
    outline: none !important;
}

/* Back Button
   Specific styling for navigation back button
   ========================================================================== */
.back-btn {
    /* Layout */
    width: 49% !important;
    height: 38px !important;
    float: left !important;
    margin-left: 1% !important;
    
    /* Visual styling */
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: #ffffff !important;
    border: 1px solid #495057 !important;
    border-radius: 4px !important;
    cursor: pointer;
    
    /* Typography */
    font-family: 'Lato', Calibri, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    line-height: 38px !important;
    
    /* Effects */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease !important;
}

.back-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4043 100%) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-1px) !important;
}

.back-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.back-btn:focus {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
}

/* Button Components (Legacy - keeping for backwards compatibility)
   Base button class with modifiers for variants
   ========================================================================== */
.btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}

.btn--sm {
    height: 30px;
    line-height: 30px;
    font-size: 13px;
}

.btn--md {
    height: 38px;
    line-height: 38px;
    font-size: 14px;
}

.btn--block {
    display: block;
    width: 100%;
}

.btn--azure {
    background-color: #0078d4;
    color: #ffffff;
}

.btn--azure:hover {
    background-color: #106ebe;
}

.btn--azure:focus {
    outline: 2px solid #0078d4;
    outline-offset: 2px;
}

.btn--azure:active {
    background-color: #005a9e;
}

/* Form Overrides
   Specific overrides for .form-2 context - but exclude our custom buttons
   ========================================================================== */
.form-2 .btn--azure {
    float: none;
    margin-top: 10px;
    margin-left: 0;
}

/* Ensure proper button sizing in form-2 context - but exclude Azure button */
.form-2 input[type=submit]:not(.azure-signin-btn),
.form-2 .log-twitter {
    height: 32px;
    line-height: 24px;
    font-size: 14px;
    width: 98%;
    float: inherit;
    position: center;
    box-shadow: inset 0 1px rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Lato', Calibri, Arial, sans-serif;
    text-align: center;
    font-weight: bold;
}

/* Continue/Submit button specific styling - but exclude Azure and Back buttons */
.form-2 input[type=submit]:not(.azure-signin-btn):not(.back-btn) {
    margin-left: 0%;
}

/* Sign up link specific styling */
.form-2 .log-twitter {
    margin-right: 1%;
}

/* Legacy Link
   ========================================================================== */
.legacy-link {
    display: block;
    margin-top: 15px;
    color: #666666;
    text-align: center;
    text-decoration: none;
}

.legacy-link:hover {
    color: #0078d4;
    text-decoration: underline;
}

/* Legacy Note
   ========================================================================== */
.legacy-note {
    margin-top: 15px;
    padding: 12px;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

.legacy-note strong {
    color: #664d03;
}

/* Utility Classes
   ========================================================================== */
.u-text-center {
    text-align: center;
}

.u-mt-sm {
    margin-top: 8px;
}

.u-mt-md {
    margin-top: 15px;
}

.u-mt-lg {
    margin-top: 20px;
}
