/*
 * Password Management Servlets (PWM) - UPM-ID Universal Responsive Stylesheet
 * Universiti Putra Malaysia
 */

*, *:before, *:after {
    box-sizing: border-box;
}

html {
    background: #f0f4f8 url('tulips-bg.jpg') no-repeat top center;
    background-size: 100% 260px;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
    margin: 0;
    padding: 0;
    min-height: 100%;
}

p {
    color: #4a5568;
    line-height: 1.5;
    margin: 0 0 14px 0;
}

p:empty {
    display: none !important;
}

#header-warning {
    width: 100%;
    background-color: #fff3cd;
    color: #856404;
    text-align: center;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: 1px solid #ffeeba;
    font-weight: bold;
    font-size: 13px;
}

#header {
    width: 100%;
    min-height: 80px;
    margin: 0;
    background: transparent;
    position: relative;
    padding: 12px 16px;
    box-sizing: border-box;
    z-index: 5;
}

#header-company-logo {
    position: absolute;
    top: 12px;
    left: 20px;
    width: 140px;
    height: 55px;
    background: url('logo.png') no-repeat left center;
    background-size: contain;
    z-index: 10;
}

#header-page {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 170px 0 170px;
    box-sizing: border-box;
    font-family: 'Trebuchet MS', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
    line-height: 1.2;
}

#header-title {
    width: 100%;
    max-width: 100%;
    margin: 3px auto 0 auto;
    padding: 0 170px;
    box-sizing: border-box;
    font-family: 'Trebuchet MS', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: #E2ECF8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    text-align: center;
}

#header div[align="right"] {
    position: absolute;
    top: 14px;
    right: 20px;
    font-size: 12px;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    margin: 0;
    z-index: 10;
}

#header div[align="right"] a,
#header div[align="right"] u,
#localeSelectionMenu {
    color: #FFFFFF !important;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

#wrapper {
    width: 100%;
    min-height: 100%;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#centerbody {
    background-color: #ffffff;
    color: #333333;
    padding: 26px 26px 30px 26px !important;
    border: 1px solid #dce2ec;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.10);
    width: 92% !important;
    max-width: 460px !important;
    min-width: 0 !important;
    margin: 18px auto 35px auto !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: both;
}

#centerbody h2 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 12px;
    margin-bottom: 6px;
}

.form-instruction {
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #4b5563 !important;
    margin-bottom: 14px !important;
    background: #f8fafc !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    border-left: 3px solid #8B0000 !important;
    box-sizing: border-box !important;
}

.form-instruction:empty {
    display: none !important;
}

#PasswordRequirements {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
}

#PasswordRequirements ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.65;
}

#PasswordRequirements li {
    margin-bottom: 3px;
    color: #475569;
}

#autoGeneratePassword, #passwordGuide {
    font-size: 12px;
    margin: 2px 0;
}

#autoGeneratePassword a, #passwordGuide a {
    color: #8B0000 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #fdf2f2 !important;
    border: 1px solid #fecaca !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

#autoGeneratePassword a:hover, #passwordGuide a:hover {
    background: #8B0000 !important;
    color: #ffffff !important;
    border-color: #8B0000 !important;
}


/* ==========================================================================
   Modern Stepper Component
   ========================================================================== */

.registration-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf2f7;
    box-sizing: border-box;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #f7fafc;
    color: #718096;
    border: 2px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.stepper-item.active .step-num {
    background-color: #8B0000;
    color: #ffffff;
    border-color: #8B0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.18);
}

.stepper-item.completed .step-num {
    background-color: #276749;
    color: #ffffff;
    border-color: #276749;
}

.step-label {
    font-size: 11px;
    color: #718096;
    margin-top: 5px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.stepper-item.active .step-label {
    color: #8B0000;
    font-weight: bold;
}

.stepper-item.completed .step-label {
    color: #276749;
}

.stepper-line {
    flex: 1 1 auto;
    height: 2px;
    background-color: #e2e8f0;
    margin: 0 4px 16px 4px;
    transition: background-color 0.3s ease;
}

.stepper-line.filled {
    background-color: #276749;
}

/* ==========================================================================
   Form Table Modernization
   ========================================================================== */

table#form {
    border: none !important;
    background: transparent !important;
    width: 100% !important;
    margin: 6px 0 14px 0 !important;
}

table#form tr {
    border: none !important;
    display: block !important;
    margin-bottom: 12px !important;
}

table#form td {
    border: none !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

table#form td.key {
    text-align: left !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    padding-bottom: 5px !important;
    width: 100% !important;
}

table#form input {
    border: 1px solid #cbd5e0 !important;
    border-radius: 6px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    height: 40px !important;
    width: 100% !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

table#form input:focus {
    border-color: #9b111e !important;
    box-shadow: 0 0 0 3px rgba(155, 17, 30, 0.15) !important;
    outline: none !important;
}

.inputfield {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 9px 12px !important;
    height: 40px !important;
    border: 1px solid #cbd5e0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    margin: 4px 0 12px 0 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

.inputfield:focus {
    border-color: #9b111e !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(155, 17, 30, 0.15) !important;
}

.changepasswordfield {
    width: 100% !important;
    box-sizing: border-box !important;
}

#buttonbar {
    margin-top: 22px !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    text-align: center;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn {
    font-family: inherit;
    font-size: 13px !important;
    font-weight: bold !important;
    border-style: none !important;
    border-radius: 6px !important;
    padding: 9px 18px !important;
    margin: 2px !important;
    text-decoration: none;
    color: #ffffff !important;
    background: #8B0000 !important;
    background: linear-gradient(180deg, #9b111e 0%, #700000 100%) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1 1 auto !important;
    min-width: 85px !important;
    text-align: center;
}

.btn:hover {
    background: linear-gradient(180deg, #b01524 0%, #850000 100%) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn:disabled {
    color: #a0aec0 !important;
    background: #e2e8f0 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

.menubutton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 9px 16px !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    margin: 4px 3px !important;
    text-decoration: none;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #8B0000 !important;
    background: #fdf2f2 !important;
    border: 1px solid #f5c6cb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    text-align: center;
    flex: 1 1 calc(50% - 10px) !important;
    min-width: 140px !important;
}

.menubutton:hover {
    background: #8B0000 !important;
    color: #ffffff !important;
    border-color: #8B0000 !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
}

.menubutton:active {
    transform: translateY(1px);
}

#LogoutButton {
    height: 26px;
    width: 26px;
    border-width: 0;
    display: block;
    background: url('logout.png') no-repeat center center;
    background-size: contain;
}

#WaitDialogBlank {
    height: 46px;
    width: 46px;
    margin-left: auto;
    margin-right: auto;
    background: url('wait.gif') no-repeat center center;
}

#footer {
    position: relative;
    text-align: center;
    width: 100%;
    color: #64748b;
    font-size: 12px;
    margin-top: auto;
    padding: 20px 14px 24px 14px;
    box-sizing: border-box;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    max-width: 700px;
    margin: 0 auto;
    font-size: 12px;
    color: #475569;
}

.footer-links .sep {
    color: #94a3b8;
    user-select: none;
}

a {
    color: #8B0000;
    text-decoration: underline;
    font-weight: bold;
}

.message {
    display: block;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 6px;
    margin: 10px auto;
    font-size: 13px;
}

.message-info {
    background-color: #edf2f7;
    color: #2d3748;
    border-left: 4px solid #4a5568;
}

.message-error {
    background-color: #fff5f5;
    color: #9b2c2c;
    border-left: 4px solid #e53e3e;
}

.message-success {
    background-color: #f0fff4;
    color: #22543d;
    border-left: 4px solid #38a169;
}

table {
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background-color: #ffffff;
}

table td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
}

table td.title {
    text-align: center;
    font-weight: bold;
    font-size: 120%;
    padding: 12px;
    background-color: #f7fafc;
    color: #2d3748;
}

table td.key {
    text-align: right;
    font-weight: bold;
    padding-right: 14px;
    width: 40%;
    color: #4a5568;
}

/* ==========================================================================
   Dojo Dialog / Modal Styling (UPM Modern Theme)
   ========================================================================== */

.dijitDialog, #dialogPopup {
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3) !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 94vw !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.dijitDialogTitleBar {
    background: linear-gradient(135deg, #8B0000 0%, #600000 100%) !important;
    color: #ffffff !important;
    padding: 12px 18px !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.dijitDialogTitle {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
}

.dijitDialogCloseIcon {
    position: static !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") no-repeat center center !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    opacity: 0.85 !important;
    transition: opacity 0.2s, transform 0.2s !important;
}

.dijitDialogCloseIcon:hover {
    opacity: 1 !important;
    transform: scale(1.1) !important;
}

.dijitDialogPaneContent {
    padding: 18px 20px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.dijitDialogUnderlay {
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(2px) !important;
}

.random-pass-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 12px !important;
    margin-bottom: 16px !important;
    max-height: 290px !important;
    overflow-y: auto !important;
    padding: 2px !important;
}

.random-pass-btn {
    display: block !important;
    padding: 8px 10px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    text-decoration: none !important;
    text-align: center !important;
    word-break: break-all !important;
    transition: all 0.15s ease !important;
}

.random-pass-btn:hover {
    background: #fee2e2 !important;
    color: #8B0000 !important;
    border-color: #fca5a5 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(139, 0, 0, 0.1) !important;
}

/* ==========================================================================
   Progressive Responsive Breakpoints
   ========================================================================== */

@media (max-width: 680px) {
    html {
        background-size: 100% 280px;
    }

    #header {
        padding: 14px 12px 10px 12px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #header-company-logo {
        position: static !important;
        margin: 0 auto 6px auto !important;
        width: 135px !important;
        height: 50px !important;
        background-position: center center !important;
    }

    #header-page {
        padding: 0 !important;
        font-size: 19px !important;
    }

    #header-title {
        padding: 0 !important;
        font-size: 12px !important;
        margin-top: 2px !important;
    }

    #header div[align="right"] {
        position: static !important;
        margin-top: 8px !important;
        text-align: center !important;
        font-size: 11px !important;
    }

    #centerbody {
        width: 94% !important;
        margin: 12px auto 25px auto !important;
        padding: 20px 16px 24px 16px !important;
        border-radius: 10px !important;
    }

    .step-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .step-label {
        font-size: 9px;
    }

    .stepper-line {
        margin: 0 2px 12px 2px;
    }

    .menubutton {
        flex: 1 1 100% !important;
        width: 100% !important;
        margin: 4px 0 !important;
    }
}
